DOP-C02 · Question #404
A company is implementing a CI/CD pipeline for an application by using AWS CodePipeline and AWS CodeBuild. The company needs a solution to run unit tests and automatically generate code coverage…
The correct answer is C. Create a CodeBuild project with a buildspec.yml file that includes commands to run unit tests and. By using a CodeBuild project with a buildspec.yml that runs your unit tests, generates the coverage report, and then checks the coverage percentage, you get native integration with CodePipeline. If the coverage check script exits non-zero when coverage is below 80%, the…
Question
A company is implementing a CI/CD pipeline for an application by using AWS CodePipeline and AWS CodeBuild. The company needs a solution to run unit tests and automatically generate code coverage reports before any code is deployed to production. The CI/CD pipeline execution must fail if the code coverage is less than 80%. Which solution will meet these requirements?
Options
- ACreate an AWS Lambda function to run unit tests and generate code coverage reports. Add a
- BCreate an AWS Step Functions workflow to run unit tests and generate code coverage reports.
- CCreate a CodeBuild project with a buildspec.yml file that includes commands to run unit tests and
- DCreate a CodeBuild project with Jenkins installed. Configure Jenkins to run unit tests and
How the community answered
(32 responses)- A3% (1)
- B16% (5)
- C72% (23)
- D9% (3)
Explanation
By using a CodeBuild project with a buildspec.yml that runs your unit tests, generates the coverage report, and then checks the coverage percentage, you get native integration with CodePipeline. If the coverage check script exits non-zero when coverage is below 80%, the CodeBuild action (and thus the pipeline) will automatically fail. This approach uses fully managed CI/CD services with minimal extra infrastructure or orchestration.
Topics
Community Discussion
No community discussion yet for this question.