Auto-discover reports in CodeBuild
With auto-discovery, CodeBuild searches through all your build files after the build phase has completed, searches for any supported report file types, and automatically creates new test and code coverage report groups and reports. For any discovered report types, CodeBuild creates new report groups with the following pattern:
<project-name>
-<report-file-format>
-AutoDiscovered
Note
If the discovered report files have the same format type, they will be placed in to the same report group or report.
Report auto-discover is configured by your project environment variables:
CODEBUILD_CONFIG_AUTO_DISCOVER
-
This variable determines whether report auto-discover is disabled during the build. By default, report auto-discover is enabled for all builds. To disable this feature, set
CODEBUILD_CONFIG_AUTO_DISCOVER
tofalse
. CODEBUILD_CONFIG_AUTO_DISCOVER_DIR
-
(Optional) This variable determines where CodeBuild searches for potential report files. Note that by default, CodeBuild searches in
**/*
by default.
These environment variables can be modified during the build phase. For example, if you only want to enable report auto-discover
for builds on the main
git branch, you can check the git branch during the build process and set CODEBUILD_CONFIG_AUTO_DISCOVER
to false if the build is
not on the main
branch. Report auto-discover can be disabled using the console or using project environment variables.
Topics
Configure report auto-discover using the console
Use the following procedure to configure report auto-discovery using the console.
To configure report auto-discover using the console
-
Create a build project or choose a build project to edit. For information, see Create a build project in AWS CodeBuild or Change build project settings in AWS CodeBuild.
-
In Environment, select Additional configuration.
-
To disable report auto-discover, in Report auto-discover, select Disable report auto-discover.
-
(Optional) In Auto-discover directory - optional, enter a directory pattern for CodeBuild to search for supported report format files. Note that CodeBuild searches in
**/*
by default.
Configure report auto-discover using project environment variables
Use the following procedure to configure report auto-discovery using project environment variables.
To configure report auto-discover using project environment variables
-
Create a build project or choose a build project to edit. For information, see Create a build project in AWS CodeBuild or Change build project settings in AWS CodeBuild.
-
In Environment variables, do the following:
-
To disable report auto-discover, for Name, enter
CODEBUILD_CONFIG_AUTO_DISCOVER
and for Value, enterfalse
. This disables report auto-discover. -
(Optional) For Name, enter
CODEBUILD_CONFIG_AUTO_DISCOVER_DIR
and for Value, enter the directory where CodeBuild should search for supported report format files. For example,output/*xml
searches for.xml
files in theoutput
directory
-