Google Cloud Professional Cloud DevOps Engineer — Question 137
You are developing reusable infrastructure as code modules. Each module contains integration tests that launch the module in a test project. You are using GitHub for source control. You need to continuously test your feature branch and ensure that all code is tested before changes are accepted. You need to implement a solution to automate the integration tests. What should you do?
Answer options
- A. Use a Jenkins server for CI/CD pipelines. Periodically run all tests in the feature branch.
- B. Ask the pull request reviewers to run the integration tests before approving the code.
- C. Use Cloud Build to run the tests. Trigger all tests to run after a pull request is merged.
- D. Use Cloud Build to run tests in a specific folder. Trigger Cloud Build for every GitHub pull request.
Correct answer: D
Explanation
The correct answer is D because it ensures that integration tests are automatically triggered for every GitHub pull request, allowing for immediate feedback on the changes. Option A is less efficient as it runs tests periodically rather than on each pull request. Option B relies on manual effort from reviewers, which is not a scalable solution. Option C runs tests only after a pull request is merged, which does not allow for issues to be identified before merging.