Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chore: Print runtime env for integration tests #1865

Merged
merged 6 commits into from
Jul 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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
)}`
);

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is great. Thanks for adding the logging.

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