SDLC Automation
A CodeBuild project runs unit tests and publishes a coverage report, but builds succeed when coverage falls below the required 80%. What should the team add to enforce the requirement?
Show the answer
Correct answerD. A test-runner coverage threshold that fails the build
AWhy not this: A dashboard alarm provides monitoring rather than directly enforcing the test runner's build result.
BWhy not this: An artifact preserves the report for later use but does not evaluate coverage or block the build.
CWhy not this: A report group stores and displays results; it does not automatically enforce a coverage threshold.
DWhy this is right: An enforced coverage threshold makes insufficient coverage fail the test command and therefore the build.
Configure the test runner to return a failure when coverage is below 80%, and let that failure fail the build. Publishing results to a report group makes coverage visible but does not itself enforce a minimum.