PROFESSIONAL-CLOUD-DEVOPS-ENGINEER · Question #90
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 contin
The correct answer is D. Use Cloud Build to run tests in a specific folder. Trigger Cloud Build for every GitHub pull request.. To continuously test IaC modules on feature branches before merge, use Cloud Build triggered by every GitHub pull request, running tests in specific module folders.
Question
Options
- AUse a Jenkins server for CI/CD pipelines. Periodically run all tests in the feature branch.
- BAsk the pull request reviewers to run the integration tests before approving the code.
- CUse Cloud Build to run the tests. Trigger all tests to run after a pull request is merged.
- DUse Cloud Build to run tests in a specific folder. Trigger Cloud Build for every GitHub pull request.
How the community answered
(37 responses)- A3% (1)
- B5% (2)
- C11% (4)
- D81% (30)
Why each option
To continuously test IaC modules on feature branches before merge, use Cloud Build triggered by every GitHub pull request, running tests in specific module folders.
A Jenkins server could be used, but 'periodically run all tests' does not align with the requirement to 'continuously test your feature branch' and 'before changes are accepted' as effectively as a direct pull request trigger.
Asking pull request reviewers to run integration tests is a manual process and does not fulfill the requirement to 'automate the integration tests' or ensure consistent execution.
Triggering all tests to run *after* a pull request is merged means that potential issues would only be discovered after the code is already integrated into the main branch, violating the 'before changes are accepted' requirement.
Using Cloud Build to run tests triggered by every GitHub pull request ensures that continuous testing is performed automatically on feature branches before merging, which aligns with the requirement for all code to be tested before acceptance. Running tests in a specific folder allows for targeted testing of individual modules, optimizing CI pipeline efficiency.
Concept tested: Cloud Build CI with GitHub pull requests
Source: https://cloud.google.com/cloud-build/docs/automate-builds-with-triggers/configure-github-app-triggers
Topics
Community Discussion
No community discussion yet for this question.