Skip to content

Commit 0322c5d

Browse files
author
Ace Nassri
authored
Fix GCF failures on Kokoro (#730)
* Add missing dependencies * Take 2 * Fix functions test * Fix KMS test failing due to pagination * Fix lint * Add code to start GCF emulator * Add missing semistandard dependency * Fix functions/helloworld build script
1 parent bbc3e07 commit 0322c5d

File tree

7 files changed

+16
-3
lines changed

7 files changed

+16
-3
lines changed

.kokoro/build.sh

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@
1717
export GCLOUD_PROJECT=nodejs-docs-samples-tests
1818
export NODE_ENV=development
1919

20+
export FUNCTIONS_TOPIC=my-topic
21+
export FUNCTIONS_BUCKET=my-bucket
22+
2023
cd github/nodejs-docs-samples/${PROJECT}
2124

2225
# Install dependencies
@@ -27,6 +30,11 @@ export GOOGLE_APPLICATION_CREDENTIALS=${KOKORO_GFILE_DIR}/secrets-key.json
2730
gcloud auth activate-service-account --key-file "$GOOGLE_APPLICATION_CREDENTIALS"
2831
gcloud config set project $GCLOUD_PROJECT
2932

33+
# Start functions emulator, if appropriate
34+
if [[ $PROJECT == functions/* ]]; then
35+
functions-emulator start
36+
fi
37+
3038
npm test
3139

32-
exit $?
40+
exit $?

.kokoro/lint.sh

100644100755
File mode changed.

appengine/cloudsql_postgresql/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@
3131
},
3232
"devDependencies": {
3333
"@google-cloud/nodejs-repo-tools": "2.2.1",
34-
"ava": "0.25.0"
34+
"ava": "0.25.0",
35+
"semistandard": "^12.0.1"
3536
},
3637
"cloud-repo-tools": {
3738
"requiresKeyFile": true,

functions/helloworld/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
"safe-buffer": "5.1.1"
2525
},
2626
"devDependencies": {
27+
"@google-cloud/functions-emulator": "^1.0.0-beta.5",
2728
"@google-cloud/nodejs-repo-tools": "^2.2.5",
2829
"@google-cloud/pubsub": "^0.17.0",
2930
"@google-cloud/storage": "^1.5.0",

functions/ocr/app/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
"@google-cloud/nodejs-repo-tools": "1.4.17",
2828
"ava": "0.22.0",
2929
"proxyquire": "1.8.0",
30+
"semistandard": "^12.0.1",
3031
"sinon": "3.2.1"
3132
},
3233
"cloud-repo-tools": {

functions/slack/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
"@google-cloud/nodejs-repo-tools": "2.1.0",
2424
"ava": "0.23.0",
2525
"proxyquire": "1.8.0",
26+
"semistandard": "^12.0.1",
2627
"sinon": "4.0.2"
2728
},
2829
"cloud-repo-tools": {

kms/system-test/keys.test.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ const plaintext = path.join(__dirname, `../resources/plaintext.txt`);
3333
const ciphertext = path.join(__dirname, `../resources/plaintext.txt.encrypted`);
3434
const decrypted = path.join(__dirname, `../resources/plaintext.txt.decrypted`);
3535

36+
const unspecifiedKeyRingName = `projects/${projectId}/locations/global/keyRings/`;
3637
const formattedKeyRingName = `projects/${projectId}/locations/global/keyRings/${keyRingName}`;
3738
const formattedKeyName = `${formattedKeyRingName}/cryptoKeys/${keyNameOne}`;
3839

@@ -70,7 +71,7 @@ test.serial(`should create a key ring`, async (t) => {
7071
test.serial(`should list key rings`, async (t) => {
7172
await tools.tryTest(async () => {
7273
const output = await tools.runAsync(`${cmd} keyrings list`, cwd);
73-
t.regex(output, new RegExp(formattedKeyRingName));
74+
t.regex(output, new RegExp(unspecifiedKeyRingName));
7475
}).start();
7576
});
7677

0 commit comments

Comments
 (0)