Q85 — AWS DVA-C02 Ch.1

Question 85 of 100 | ← Chapter 1

A developer is using AWS CodePipeline as the CI/CD mechanism for a web application. The developer added unit tests to programmatically verify application code functionality. Unit tests generate a test report showing results for each individual check. The developer now wants to automatically execute these tests within the CI/CD pipeline. Which solution meets this requirement with the least operational effort?

Correct Answer: C. Add a new stage to the pipeline. Use AWS CodeBuild as the provider. Add the new stage before the stage that deploys code revisions to the test environment. Write a build specification that fails the CodeBuild stage if any test fails. Use CodeBuild’s test reporting feature to integrate reports with the CodeBuild console. View test results in CodeBuild and resolve issues.

Explanation

Option C satisfies both key requirements: (1) tests run *before* deployment (enabling fast failure feedback), and (2) leverages native AWS services (CodeBuild) to minimize integration overhead. CodeBuild’s built-in test reporting eliminates third-party tooling (e.g., Jenkins in D) and avoids manual local enforcement (A). Option B places testing *after* deployment, violating CI/CD best practices. Thus, C is optimal.