diff --git a/.kokoro/build.sh b/.kokoro/build.sh index 43e740b0bc..38b3a46653 100755 --- a/.kokoro/build.sh +++ b/.kokoro/build.sh @@ -15,10 +15,12 @@ # limitations under the License. export GCLOUD_PROJECT=nodejs-docs-samples-tests +export GCF_REGION=us-central1 export NODE_ENV=development -export FUNCTIONS_TOPIC=my-topic -export FUNCTIONS_BUCKET=my-bucket +export FUNCTIONS_TOPIC=integration-tests-instance +export FUNCTIONS_BUCKET=$GCLOUD_PROJECT +export BASE_URL="http://localhost:8010/${GCLOUD_PROJECT}/${GCF_REGION}" cd github/nodejs-docs-samples/${PROJECT} @@ -32,6 +34,10 @@ gcloud config set project $GCLOUD_PROJECT # Start functions emulator, if appropriate if [[ $PROJECT == functions/* ]]; then + export FUNCTIONS_LOG_PATH=$(pwd)/logs/cloud-functions-emulator.log + npm install -g @google-cloud/functions-emulator + touch "$FUNCTIONS_LOG_PATH" + functions config set logFile "$FUNCTIONS_LOG_PATH" functions-emulator start fi diff --git a/.kokoro/functions/common.cfg b/.kokoro/functions/common.cfg index 881f2f9de4..8ca89d179a 100644 --- a/.kokoro/functions/common.cfg +++ b/.kokoro/functions/common.cfg @@ -3,6 +3,9 @@ # Download trampoline resources. These will be in ${KOKORO_GFILE_DIR} gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline" +# Download secrets from Cloud Storage. +gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/nodejs-docs-samples" + # All builds use the trampoline script to run in docker. build_file: "nodejs-docs-samples/.kokoro/trampoline.sh" diff --git a/functions/helloworld/test/sample.integration.pubsub.test.js b/functions/helloworld/test/sample.integration.pubsub.test.js index 10442445ab..94971df74b 100644 --- a/functions/helloworld/test/sample.integration.pubsub.test.js +++ b/functions/helloworld/test/sample.integration.pubsub.test.js @@ -18,7 +18,7 @@ const childProcess = require(`child_process`); const test = require(`ava`); const uuid = require(`uuid`); -test(`helloPubSub: should print a name`, async (t) => { +test.serial(`helloPubSub: should print a name`, async (t) => { t.plan(1); const startTime = new Date(Date.now()).toISOString(); const name = uuid.v4(); @@ -33,7 +33,7 @@ test(`helloPubSub: should print a name`, async (t) => { t.true(logs.includes(`Hello, ${name}!`)); }); -test(`helloPubSub: should print hello world`, async (t) => { +test.serial(`helloPubSub: should print hello world`, async (t) => { t.plan(1); const startTime = new Date(Date.now()).toISOString();