Skip to content

Commit edbc9b1

Browse files
Chore: Print runtime env for integration tests (#1865)
* Print runtime env for integration tests * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * add new kokoro job * Add tests to package.json * Print less --------- Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
1 parent 5826b0a commit edbc9b1

File tree

2 files changed

+22
-2
lines changed

2 files changed

+22
-2
lines changed

dev/system-test/firestore.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,22 @@ class DeferredPromise<T> {
7777
}
7878
}
7979

80+
const firestoreEnv: {
81+
[key: string]: string | undefined;
82+
} = {};
83+
for (const key in process.env) {
84+
if (key.startsWith('FIRESTORE')) {
85+
firestoreEnv[key] = process.env[key];
86+
}
87+
}
88+
console.log(
89+
`Running system tests with environment variables:\n ${JSON.stringify(
90+
firestoreEnv,
91+
null,
92+
2
93+
)}`
94+
);
95+
8096
if (process.env.NODE_ENV === 'DEBUG') {
8197
setLogFunction(console.log);
8298
}

package.json

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,15 @@
3131
"predocs": "npm run compile",
3232
"docs": "jsdoc -c .jsdoc.js",
3333
"system-test:rest": "FIRESTORE_PREFER_REST=true mocha build/system-test --timeout 600000",
34+
"system-test:named-db:rest": "FIRESTORE_NAMED_DATABASE=test-db FIRESTORE_PREFER_REST=true mocha build/system-test --timeout 600000",
3435
"system-test:grpc": "mocha build/system-test --timeout 600000",
36+
"system-test:named-db:grpc": "FIRESTORE_NAMED_DATABASE=test-db mocha build/system-test --timeout 600000",
3537
"system-test:emulator:rest": "FIRESTORE_EMULATOR_HOST=localhost:8080 FIRESTORE_PREFER_REST=true mocha build/system-test --timeout 600000",
38+
"system-test:named-db:emulator:rest": "FIRESTORE_NAMED_DATABASE=test-db FIRESTORE_EMULATOR_HOST=localhost:8080 FIRESTORE_PREFER_REST=true mocha build/system-test --timeout 600000",
3639
"system-test:emulator:grpc": "FIRESTORE_EMULATOR_HOST=localhost:8080 mocha build/system-test --timeout 600000",
37-
"system-test": "npm run system-test:grpc && npm run system-test:rest",
38-
"system-test:emulator": "npm run system-test:emulator:grpc && npm run system-test:emulator:rest",
40+
"system-test:named-db:emulator:grpc": "FIRESTORE_NAMED_DATABASE=test-db FIRESTORE_EMULATOR_HOST=localhost:8080 mocha build/system-test --timeout 600000",
41+
"system-test": "npm run system-test:grpc && npm run system-test:rest && npm run system-test:named-db:grpc && npm run system-test:named-db:rest",
42+
"system-test:emulator": "npm run system-test:emulator:grpc && npm run system-test:emulator:rest && npm run system-test:named-db:emulator:grpc && npm run system-test:named-db:emulator:rest",
3943
"presystem-test": "npm run compile",
4044
"samples-test": "npm link && cd samples/ && npm link ../ && npm test && cd ../",
4145
"conformance": "mocha build/conformance",

0 commit comments

Comments
 (0)