Skip to content

Commit

Permalink
Fix error message, explicitly delete legacy formatted functions
Browse files Browse the repository at this point in the history
Drive-by fix: delete semistandard from global depenencies
Use correct bucket and region variable.
  • Loading branch information
fhinkel committed Jun 7, 2018
1 parent 0accf6f commit d0208ef
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 4 deletions.
5 changes: 4 additions & 1 deletion .kokoro/functions-helloworld.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

export GCLOUD_PROJECT=nodejs-docs-samples-tests
STAGE_BUCKET=$GCLOUD_PROJECT
GCP_REGION=us-central1
export GCP_REGION=us-central1
export FUNCTIONS_TOPIC=integration-test-functions
export FUNCTIONS_BUCKET=$FUNCTIONS_TOPIC
export BASE_URL=https://${GCP_REGION}-${GCLOUD_PROJECT}.cloudfunctions.net
Expand All @@ -26,6 +26,9 @@ cd github/nodejs-docs-samples/functions/helloworld
# Install dependencies
npm install

# Install global dependencies used in some integration tests.
npm install -g @google-cloud/functions-emulator@1.0.0-beta.4

# Configure gcloud
export GOOGLE_APPLICATION_CREDENTIALS=${KOKORO_GFILE_DIR}/secrets-key.json
gcloud auth activate-service-account --key-file "$GOOGLE_APPLICATION_CREDENTIALS"
Expand Down
2 changes: 1 addition & 1 deletion circle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ dependencies:
override:
- echo $KEYFILE > /home/ubuntu/nodejs-docs-samples/key.json
- gcloud auth activate-service-account --key-file /home/ubuntu/nodejs-docs-samples/key.json || true
- yarn global add ava nyc codecov semistandard @google-cloud/nodejs-repo-tools@1.4.17 @google-cloud/functions-emulator@1.0.0-beta.4
- yarn global add ava nyc codecov @google-cloud/nodejs-repo-tools@1.4.17 @google-cloud/functions-emulator@1.0.0-beta.4
- yarn install
- yarn run lint
- samples test install -l=functions/background
Expand Down
2 changes: 1 addition & 1 deletion functions/helloworld/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"scripts": {
"lint": "repo-tools lint",
"pretest": "npm run lint",
"e2e-test": "export FUNCTIONS_CMD='gcloud functions' && sh test/updateFunctions.sh && BASE_URL=\"https://$GCF_REGION-$GCLOUD_PROJECT.cloudfunctions.net/\" ava -T 20s --verbose test/*.test.js",
"e2e-test": "export FUNCTIONS_CMD='gcloud functions' && sh test/updateFunctions.sh && BASE_URL=\"https://$GCP_REGION-$GCLOUD_PROJECT.cloudfunctions.net/\" ava -T 20s --verbose test/*.test.js",
"test": "export FUNCTIONS_CMD='functions-emulator' && sh test/updateFunctions.sh && export BASE_URL=\"http://localhost:8010/$GCLOUD_PROJECT/$GCF_REGION\" && ava -T 20s --verbose -c 1 test/index.test.js test/*unit*test.js test/*integration*test.js",
"system-test": "export FUNCTIONS_CMD='functions-emulator' && sh test/updateFunctions.sh && export BASE_URL=\"http://localhost:8010/$GCLOUD_PROJECT/$GCF_REGION\" && ava -T 20s --verbose test/*.test.js"
},
Expand Down
2 changes: 1 addition & 1 deletion functions/helloworld/test/sample.system.storage.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const localFileName = `test.txt`;
// Use unique GCS filename to avoid conflicts between concurrent test runs
const gcsFileName = `test-${uuid.v4()}.txt`;

const bucketName = process.env.BUCKET_NAME;
const bucketName = process.env.FUNCTIONS_BUCKET;
const bucket = storage.bucket(bucketName);
const baseCmd = `gcloud functions`;

Expand Down
4 changes: 4 additions & 0 deletions functions/helloworld/test/updateFunctions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,12 @@ ${FUNCTIONS_CMD} deploy helloHttp --trigger-http
echo '-----------------------------'
${FUNCTIONS_CMD} deploy helloBackground --trigger-topic $FUNCTIONS_TOPIC
echo '-----------------------------'
${FUNCTIONS_CMD} delete helloPubSub -q
echo 'Deleted helloPubSub -----------------------------'
${FUNCTIONS_CMD} deploy helloPubSub --trigger-topic $FUNCTIONS_TOPIC
echo '-----------------------------'
${FUNCTIONS_CMD} delete helloGCS -q
echo 'Deleted helloGCS -----------------------------'
${FUNCTIONS_CMD} deploy helloGCS --trigger-bucket $FUNCTIONS_BUCKET
echo '-----------------------------'
${FUNCTIONS_CMD} deploy helloGCSGeneric --trigger-bucket $FUNCTIONS_BUCKET
Expand Down

0 comments on commit d0208ef

Please sign in to comment.