Skip to content

Commit 09eb5c8

Browse files
committed
Fix error message, explicitly delete legacy formatted functions
Drive-by fix: delete semistandard from global depenencies Use correct bucket and region variable.
1 parent 0accf6f commit 09eb5c8

5 files changed

Lines changed: 12 additions & 4 deletions

File tree

.kokoro/functions-helloworld.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,20 @@
1616

1717
export GCLOUD_PROJECT=nodejs-docs-samples-tests
1818
STAGE_BUCKET=$GCLOUD_PROJECT
19-
GCP_REGION=us-central1
19+
export GCP_REGION=us-central1
2020
export FUNCTIONS_TOPIC=integration-test-functions
2121
export FUNCTIONS_BUCKET=$FUNCTIONS_TOPIC
22+
export BUCKET_NAME=$
2223
export BASE_URL=https://${GCP_REGION}-${GCLOUD_PROJECT}.cloudfunctions.net
2324

2425
cd github/nodejs-docs-samples/functions/helloworld
2526

2627
# Install dependencies
2728
npm install
2829

30+
# Install global dependencies used in some integration tests.
31+
npm install -g @google-cloud/functions-emulator@1.0.0-beta.4
32+
2933
# Configure gcloud
3034
export GOOGLE_APPLICATION_CREDENTIALS=${KOKORO_GFILE_DIR}/secrets-key.json
3135
gcloud auth activate-service-account --key-file "$GOOGLE_APPLICATION_CREDENTIALS"

circle.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ dependencies:
3131
override:
3232
- echo $KEYFILE > /home/ubuntu/nodejs-docs-samples/key.json
3333
- gcloud auth activate-service-account --key-file /home/ubuntu/nodejs-docs-samples/key.json || true
34-
- yarn global add ava nyc codecov semistandard @google-cloud/nodejs-repo-tools@1.4.17 @google-cloud/functions-emulator@1.0.0-beta.4
34+
- yarn global add ava nyc codecov @google-cloud/nodejs-repo-tools@1.4.17 @google-cloud/functions-emulator@1.0.0-beta.4
3535
- yarn install
3636
- yarn run lint
3737
- samples test install -l=functions/background

functions/helloworld/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"scripts": {
1515
"lint": "repo-tools lint",
1616
"pretest": "npm run lint",
17-
"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",
17+
"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",
1818
"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",
1919
"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"
2020
},

functions/helloworld/test/sample.system.storage.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ const localFileName = `test.txt`;
2525
// Use unique GCS filename to avoid conflicts between concurrent test runs
2626
const gcsFileName = `test-${uuid.v4()}.txt`;
2727

28-
const bucketName = process.env.BUCKET_NAME;
28+
const bucketName = process.env.FUNCTIONS_BUCKET;
2929
const bucket = storage.bucket(bucketName);
3030
const baseCmd = `gcloud functions`;
3131

functions/helloworld/test/updateFunctions.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,12 @@ ${FUNCTIONS_CMD} deploy helloHttp --trigger-http
77
echo '-----------------------------'
88
${FUNCTIONS_CMD} deploy helloBackground --trigger-topic $FUNCTIONS_TOPIC
99
echo '-----------------------------'
10+
${FUNCTIONS_CMD} delete helloPubSub -q
11+
echo 'Deleted helloPubSub -----------------------------'
1012
${FUNCTIONS_CMD} deploy helloPubSub --trigger-topic $FUNCTIONS_TOPIC
1113
echo '-----------------------------'
14+
${FUNCTIONS_CMD} delete helloGCS -q
15+
echo 'Deleted helloGCS -----------------------------'
1216
${FUNCTIONS_CMD} deploy helloGCS --trigger-bucket $FUNCTIONS_BUCKET
1317
echo '-----------------------------'
1418
${FUNCTIONS_CMD} deploy helloGCSGeneric --trigger-bucket $FUNCTIONS_BUCKET

0 commit comments

Comments
 (0)