
Answer-first summary for fast verification
Answer: Use Cloud Build to run tests in a specific folder. Trigger Cloud Build for every GitHub pull request.
To automate the integration tests for your feature branch in GitHub and ensure all code is tested before changes are accepted, the best approach is to use a CI/CD tool that integrates directly with GitHub and can be triggered by pull requests. Option D suggests using Cloud Build to run tests in a specific folder and triggering Cloud Build for every GitHub pull request. This approach ensures that tests are run automatically for every change proposed in a pull request, providing immediate feedback and ensuring that only tested code is merged. Option A suggests using Jenkins, which is a valid CI/CD tool but does not specify integration with GitHub pull requests, making it less optimal for this scenario. Option B, asking reviewers to run tests manually, is not scalable or reliable for continuous testing. Option C suggests running tests after a pull request is merged, which does not prevent untested code from being merged.
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
You are developing reusable infrastructure as code modules with integration tests that deploy each module in a test project. Using GitHub for source control, you want to continuously test feature branches and ensure all code is validated before merging. How can you automate the integration testing process?
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.
No comments yet.