Cloud Function source is in Cloud Source Repositories. Only one service account can deploy. Ensure code cannot be deployed unless unit tests pass. How should you configure the testing and deployment process?
Choose an answer
Tap an option to check your answer.
Correct answer: Configure Cloud Build to run unit tests using the specific service account as the build agent; if tests pass, Cloud Build deploys the Cloud Function..
Why this is the answer
The correct answer leverages Cloud Build for automated testing and deployment, which is a standard CI/CD practice. Cloud Build can execute unit tests, and if they pass, proceed with deploying the Cloud Function. Using a specific service account as the build agent ensures that only authorized deployments occur, addressing the requirement for a single service account to deploy. The first incorrect option introduces a manual approval step, which isn't necessary if the goal is automated deployment upon successful tests. The second incorrect option suggests running unit tests after deployment, which defeats the purpose of preventing bad code from reaching production. The third incorrect option requires manual deployment by the developer, which contradicts the automation goal and doesn't utilize the specific service account for deployment directly through the pipeline.
Pass your exam — without the endless answer hunt
Get every verified question and explanation for this exam in one place, and save hours of prep. 1,000+ certifications · 20+ languages · free to start.
Pass your exam faster → No card needed