Skill 1.2.4
Automating unit tests and code coverage
Key Concepts
CodeBuild report groups collect test results (JUnit XML, Cucumber, TestNG, NUnit, TRX) and coverage reports (JaCoCo, Cobertura, SimpleCov, Clover) declared in the reports section of the buildspec. The console shows pass rates, durations and line and branch coverage over time.
To enforce a minimum, add a step that reads the coverage result and exits non-zero below the threshold, failing the build. Unit tests should not need deployed infrastructure; mock AWS calls (for example with moto or the SDK's stubbing) so they stay fast and reliable.