A software engineering team is constructing an automated local integration testing suite for an application that interacts with Cloud Bigtable. To run offline integration tests within an isolated CI container environment without network access to Google Cloud, the team starts the local emulator using `gcloud beta emulators bigtable start`. However, when test cases run, the application client library attempts to reach live Google Cloud endpoints and fails due to missing internet connectivity. Which configuration step must be performed so that the Cloud Bigtable client library routes requests directly to the locally running emulator process?
- Export the BIGTABLE_EMULATOR_HOST environment variable set to the host address and port where the emulator is running prior to executing the client application.Cevap
- BGrant the primitive Owner role (roles/owner) to a local service account key file and reference it via standard Application Default Credentials.
- CStore the Bigtable schema and emulator data in an unversioned local directory and synchronize it to a Cloud Storage backend using Terraform prior to test execution.
- DProvision an isolated Google Kubernetes Engine (GKE) cluster in GCP for each test runner to host the Bigtable emulator container.
Cevap
Export the BIGTABLE_EMULATOR_HOST environment variable set to the host address and port where the emulator is running prior to executing the client application.
The Cloud Bigtable emulator runs as a local process. Official GCP client SDKs look for the BIGTABLE_EMULATOR_HOST environment variable upon initialization. When present, the SDK sends API calls to the specified local port instead of authenticating with live Google Cloud end points.
Adım Adım Çözüm
Anahtar Kavram
Cloud Bigtable Emulator Host Environment Variable Configuration