GCP Professional Cloud Architect Practice Question

Your team maintains a Go microservice that writes data to Cloud Spanner and publishes events to Pub/Sub. For every commit, a Cloud Build pipeline must run integration tests that verify real SQL transactions and message publishing. The private Cloud Build pool has no external network egress, and management wants to avoid additional GCP charges while keeping test execution under one minute. Which testing approach best satisfies these constraints?

  • Provision a non-production GCP project in Terraform, create Spanner and Pub/Sub resources on each pipeline run, and point the tests to that project using service-account impersonation.

  • Replace Spanner calls with an in-memory SQLite database and substitute Pub/Sub with a local mock library; run unit-level tests that assert method invocations.

  • Within the test step, launch the Spanner and Pub/Sub emulators using the Cloud SDK (for example, gcloud beta emulators spanner start and gcloud beta emulators pubsub start), set the SPANNER_EMULATOR_HOST and PUBSUB_EMULATOR_HOST environment variables, then run the integration tests against those emulated endpoints.

  • Deploy the microservice to a staging GKE cluster inside the same VPC and execute the test suite through internal load-balancer endpoints that connect to real Spanner and Pub/Sub instances.

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