Q2 — AWS DVA-C02 Ch.3
Question 2 of 100 | ← Chapter 3
A company runs a containerized application on AWS and uses AWS CodePipeline for its CI/CD pipeline. Developers must run unit tests and include them as part of the pipeline before testing artifacts. How should developers incorporate unit tests as part of the CI/CD pipeline?
- A. Create a separate CodePipeline pipeline to run unit tests.
- B. Update the AWS CodeBuild specification to include a phase that runs unit tests. ✓
- C. Install the AWS CodeDeploy agent on an Amazon EC2 instance to run unit tests.
- D. Create a test branch in AWS CodeCommit to run unit tests.
Correct Answer: B. Update the AWS CodeBuild specification to include a phase that runs unit tests.
Explanation
Updating the AWS CodeBuild specification to include a phase that runs unit tests integrates testing natively into the build process, ensuring tests execute automatically as part of the pipeline before artifact promotion—aligning with standard CI/CD best practices.