Skip to content

Commit

Permalink
Chore: Print runtime env for integration tests (#1865)
Browse files Browse the repository at this point in the history
* 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>
  • Loading branch information
wu-hui and gcf-owl-bot[bot] committed Jul 25, 2023
1 parent 5826b0a commit edbc9b1
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 2 deletions.
16 changes: 16 additions & 0 deletions dev/system-test/firestore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,22 @@ class DeferredPromise<T> {
}
}

const firestoreEnv: {
[key: string]: string | undefined;
} = {};
for (const key in process.env) {
if (key.startsWith('FIRESTORE')) {
firestoreEnv[key] = process.env[key];
}
}
console.log(
`Running system tests with environment variables:\n ${JSON.stringify(
firestoreEnv,
null,
2
)}`
);

if (process.env.NODE_ENV === 'DEBUG') {
setLogFunction(console.log);
}
Expand Down
8 changes: 6 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,15 @@
"predocs": "npm run compile",
"docs": "jsdoc -c .jsdoc.js",
"system-test:rest": "FIRESTORE_PREFER_REST=true mocha build/system-test --timeout 600000",
"system-test:named-db:rest": "FIRESTORE_NAMED_DATABASE=test-db FIRESTORE_PREFER_REST=true mocha build/system-test --timeout 600000",
"system-test:grpc": "mocha build/system-test --timeout 600000",
"system-test:named-db:grpc": "FIRESTORE_NAMED_DATABASE=test-db mocha build/system-test --timeout 600000",
"system-test:emulator:rest": "FIRESTORE_EMULATOR_HOST=localhost:8080 FIRESTORE_PREFER_REST=true mocha build/system-test --timeout 600000",
"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",
"system-test:emulator:grpc": "FIRESTORE_EMULATOR_HOST=localhost:8080 mocha build/system-test --timeout 600000",
"system-test": "npm run system-test:grpc && npm run system-test:rest",
"system-test:emulator": "npm run system-test:emulator:grpc && npm run system-test:emulator:rest",
"system-test:named-db:emulator:grpc": "FIRESTORE_NAMED_DATABASE=test-db FIRESTORE_EMULATOR_HOST=localhost:8080 mocha build/system-test --timeout 600000",
"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",
"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",
"presystem-test": "npm run compile",
"samples-test": "npm link && cd samples/ && npm link ../ && npm test && cd ../",
"conformance": "mocha build/conformance",
Expand Down

0 comments on commit edbc9b1

Please sign in to comment.