Google Professional Cloud DevOps Engineer exam dumps

Google Professional Cloud DevOps Engineer practice question 192 of 268

Professional Cloud DevOps Engineer. Associate level, Google Cloud. Free question with the correct answer and a full explanation.

Google Professional Cloud DevOps Engineer Question 192

Select 4Google Cloud Platform

Your team uses Cloud Build for continuous integration (CI) and has recently implemented a new policy to ensure all code changes are thoroughly tested before being merged into the main branch. To enforce this, you need to configure Cloud Build to execute unit tests automatically for every pull request and only allow merging if the tests pass. Additionally, you want to ensure that build logs are easily accessible for debugging any failed runs. Which combination of steps should you take to achieve this?

  1. A

    Configure a trigger in Cloud Build that runs on pull request events targeting the main branch.

  2. B

    Write a Cloud Build configuration file defining steps to execute unit tests and upload test artifacts.

  3. C

    Enable the 'Require status checks to pass before merging' option in your repository.

  4. D

    Deploy a custom Cloud Function to analyze build logs and notify developers of failures.

  5. E

    Enable Cloud Logging for Cloud Build to centralize and access build logs.

Show answer and explanation

Correct answers: A, B, C, E

Explanation

To enforce a CI process where unit tests are automatically run for every pull request and merging is blocked unless tests pass, you need to configure a pull request trigger in Cloud Build, define the testing steps in a Cloud Build configuration file, and enable the 'Require status checks to pass before merging' option in the repository. Additionally, enabling Cloud Logging ensures that build logs are centralized and accessible for debugging. Deploying a custom Cloud Function is unnecessary for this specific scenario, as Cloud Build and the repository settings already provide the required functionality.

  • A. Correct.

    This is correct. Configuring a pull request trigger ensures that builds are automatically initiated for every pull request targeting the main branch.

  • B. Correct.

    This is correct. A Cloud Build configuration file is necessary to define the steps for executing unit tests and managing test artifacts.

  • C. Correct.

    This is correct. Enabling the 'Require status checks to pass before merging' option ensures that code cannot be merged into the main branch unless the build and tests are successful.

  • D. Incorrect.

    This is incorrect. While notifying developers is a helpful practice, deploying a custom Cloud Function is not a required or standard step to achieve the desired outcome in this scenario.

  • E. Correct.

    This is correct. Enabling Cloud Logging makes it easier to access and debug build logs in case of failures.

Timed practice exam

Take a Google Professional Cloud DevOps Engineer practice test under exam conditions

60 questions in 120 minutes, drawn from this bank, with a score report and a per-question review when you finish.

Start timed exam