AWS Certified DevOps Engineer – Professional (DOP-C02) — Question 69

A development team uses AWS CodeCommit, AWS CodePipeline, and AWS CodeBuild to develop and deploy an application. Changes to the code are submitted by pull requests. The development team reviews and merges the pull requests, and then the pipeline builds and tests the application.
Over time, the number of pull requests has increased. The pipeline is frequently blocked because of failing tests. To prevent this blockage, the development team wants to run the unit and integration tests on each pull request before it is merged.
Which solution will meet these requirements?

Answer options

Correct answer: B

Explanation

Option B is correct because it allows the development team to automatically run tests on pull requests as they are created, ensuring that only code that passes these tests is merged. Option A is incorrect as it relies on approval rules rather than automated testing before merging. Option C modifies the pipeline but does not address running tests on pull requests. Option D uses notifications rather than directly triggering tests, which does not meet the requirement for pre-merge testing.