QuestionQ105

VerifiedBuilding and testing applications

Your team is creating unit tests for Cloud Function code. The code is stored in a Cloud Source Repositories repository. You are responsible for implementing the tests. Only one specific service account has the required permissions to deploy the code to Cloud Functions. You need to ensure the code cannot be deployed until the tests have passed. How should you configure the unit-testing process?

Explanation

Cloud Build runs build steps in sequence, so unit-test steps can be placed before the Cloud Functions deployment step. Configuring the build to use the service account that holds the deployment permissions lets Cloud Build deploy only after the tests complete successfully; a failed test prevents subsequent deployment steps from running.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!