Enhancements to Buildspec YAML File
Learn the enhancements needed to create test reports while running the build.
Proper documentation of test results and related trends is essential for DevOps deployment. AWS CodeBuild allows us to generate test reports for the tests that run alongside our build. It also provides visibility to code coverage in our project. A developer needs to make a few changes to the build specification file to create these test reports.
The reports
section
reports:<report-group-name> or arn:files:- <file-location>file-format: <format-type>base-directory: <top-level-directory>discard-paths: yes|no
A build specification file commonly contains version, phase, and artifact sections. The reports
depends on the commands specified in the build phase. The build phase must run the tests and generate raw data containing test results. To create test reports from this raw data, we need to include a new section named reports
. This section starts by specifying the name of the report group. If a report group does not exist, CodeBuild will create one on the fly. But as a best practice, creating a report group and using its arn
as the report group’s name is recommended.
If a pre-existing report group name is specified, CodeBuild will reuse that report group ...