Emulator Suite warning about default project ID when GCLOUD_PROJECT is unset in CI tests
0 reputation · 14 Jun 2021, 08:59 UTC
I'm setting up integration tests against the Firebase Emulator Suite (Firestore and Auth) as part of a CI pipeline. The tests never touch production, and the emulators start correctly, but the emulator logs a warning that no project ID was provided and that it is falling back to a default project ID.
My concern is determinism: some of my test helpers construct Firestore references using a hardcoded project ID, while the emulator itself may be operating under its own fallback ID when GCLOUD_PROJECT is unset. I want to understand whether this mismatch can cause subtle failures — for example, connections silently targeting a different project namespace than the one my test fixtures assume — and whether the fallback ID is stable across emulator versions and environments.
Assume a recent Emulator Suite release and the modular JavaScript SDK with connectFirestoreEmulator.
Specifically:
- Does the emulator's default project ID remain constant across versions, or can it change and break tests that implicitly depend on it?
- Is setting
GCLOUD_PROJECT(or passing the project ID toinitializeApp) sufficient to make the emulator and client agree on the project namespace? - Are there documented cases where a project ID mismatch causes silent misbehavior rather than an explicit connection error?