DOP-C02 Practice Question 82: CodeBuild Test Reports
AWS Certified DevOps Engineer – Professional (DOP-C02) · Test 9 · question 2 of 10
A team runs unit tests during the build phase of a CodeBuild project and wants the pass/fail results and duration of each test case to appear in the CodeBuild console as a structured test report, instead of being buried in the raw build log output. The tests already produce JUnit XML files in a test-results directory. What should the team add to the buildspec to achieve this?
Show answer and explanation
Answer:
The reports section of the buildspec is exactly what CodeBuild uses to generate test reports: you point it at a report group, list the result files with files, and optionally set base-directory, and CodeBuild parses supported formats like JUnit XML to populate the pass/fail summary and duration data shown in the console.
A is wrong because uploading raw XML to a static website gives no parsing or console visualization, and a static website bucket is unrelated to test reporting. B is wrong because the artifacts section only preserves build output files for later stages; it does not parse or display test results as a report. D is wrong because exported variables pass small string values between pipeline stages, they are not a mechanism for surfacing structured test results.
Reference: Test reports in AWS CodeBuild