GCP Professional Cloud Architect Practice Question

Your team is building a CI pipeline that runs integration tests for a microservice which publishes messages to Pub/Sub topics and stores metadata in Cloud Firestore (native mode). Developers must be able to execute the same test suite on their laptops without an internet connection, and the company wants to avoid any Google Cloud billing during these tests. No application code changes are allowed between local and CI executions. What should you do?

  • Create a separate Google Cloud project that hosts dedicated Pub/Sub topics and Firestore databases for testing, authenticate with a least-privilege service account in the CI job, and delete the project every night to limit costs.

  • Replace Pub/Sub and Firestore client calls in the microservice with Mockito or similar mocks when the TEST_MODE flag is enabled, ensuring tests never reach Google Cloud endpoints.

  • Start the Pub/Sub and Cloud Firestore emulators in the CI job and on developer machines, expose them on fixed ports, and set the PUBSUB_EMULATOR_HOST and FIRESTORE_EMULATOR_HOST environment variables before running the tests.

  • Run gcloud in offline mode so that API calls are intercepted locally; the microservice will continue to use production client libraries without needing environment variables.

GCP Professional Cloud Architect
Managing implementation
Your Score:
Settings & Objectives
Random Mixed
Questions are selected randomly from all chosen topics, with a preference for those you haven’t seen before. You may see several questions from the same objective or domain in a row.
Rotate by Objective
Questions cycle through each objective or domain in turn, helping you avoid long streaks of questions from the same area. You may see some repeat questions, but the distribution will be more balanced across topics.

Check or uncheck an objective to set which questions you will receive.

Bash, the Crucial Exams Chat Bot
AI Bot