A team wants to run unit tests automatically in a CodePipeline CI/CD workflow. Tests produce a report showing each check's result. Which approach requires the least operational overhead to run these tests and surface the report during the pipeline execution?
Choose an answer
Tap an option to check your answer.
Correct answer: Add a new pipeline stage using CodeBuild before the stage that deploys code to the test environment. Fail the build if any test fails and use CodeBuild test reports to view results..
Why this is the answer
The correct answer leverages AWS CodeBuild's native integration with CodePipeline and its built-in test reporting features, offering the least operational overhead. Running unit tests before deployment to a test environment is a best practice, as it catches issues early, preventing faulty code from reaching later stages. CodeBuild can execute tests, and its test reporting functionality automatically surfaces results within the CodePipeline console. Using a Git pre-commit hook shifts the responsibility to individual developers and doesn't integrate with the CI/CD pipeline for centralized reporting or enforcement. Adding a CodeBuild stage after deployment to a test environment is less efficient, as it deploys potentially broken code. Using Jenkins introduces an external service that requires separate management, increasing operational overhead compared to a fully managed AWS service like CodeBuild.
Pass your exam — without the endless answer hunt
Get every verified question and explanation for this exam in one place, and save hours of prep. 1,000+ certifications · 20+ languages · free to start.
Pass your exam faster → No card needed