diff options
author | Leo <leo.osang@gmail.com> | 2018-08-28 11:48:41 +0000 |
---|---|---|
committer | Achilleas Pipinellis <axil@gitlab.com> | 2018-09-03 12:56:26 +0200 |
commit | cc34f7402ef4378f84221cd3da052f087d5d00e8 (patch) | |
tree | 29d78d3f415dc2c2941cea0725bf121c7f89ed9e /doc/ci | |
parent | 5fb044b05528338360c8870589be3ca396c71f3f (diff) | |
download | gitlab-ce-cc34f7402ef4378f84221cd3da052f087d5d00e8.tar.gz |
Add Java Maven example to junit_test_reports.md
Diffstat (limited to 'doc/ci')
-rw-r--r-- | doc/ci/junit_test_reports.md | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/doc/ci/junit_test_reports.md b/doc/ci/junit_test_reports.md index 9b469938f80..ff2fdff7a69 100644 --- a/doc/ci/junit_test_reports.md +++ b/doc/ci/junit_test_reports.md @@ -116,7 +116,23 @@ java: junit: build/test-results/test/TEST-*.xml ``` -If you define multiple tasks of kind test, it will generate multiple directories -under `build/test-results/` directory. -To address all subdirectory at once, you can leverage regex matching by defining following +If you define multiple tasks of kind test, it will generate multiple directories +under `build/test-results/` directory. +To address all subdirectory at once, you can leverage regex matching by defining following path: `build/test-results/test/TEST-*.xml` + +### Java example with Maven + +For parsing Surefire and Failsafe test resports use the following job in `.gitlab-ci.yml`: + +```yaml +java: + stage: test + script: + - mvn verify + artifacts: + reports: + junit: + - target/surefire-reports/TEST-*.xml + - target/failsafe-reports/TEST-*.xml +``` |