Saving Test Results
To record unit test results to the pipeline's run log:
- Run unit tests in a pipeline step that produce a results file in junit format
- Save the test results file using the
The following example pipeline demonstrates the process of generating unit test results in a Maven build and recording the results to the run log for later viewing in Pipelines.
The pipeline executes a Maven build using the MvnBuild native step. It requires that the Maven project being built has been configured to use the Maven Surefire Plugin to perform unit tests and produce a junit-compatible test result file.
onComplete action of the
execution block, the step will save the test result file to the run log by calling the
save_tests utility function.
After the pipeline has finished running, the test results for the
build_app step can be viewed in the run log.