Add Java Maven example to junit_test_reports.md

This commit is contained in:
Leo 2018-08-28 11:48:41 +00:00 committed by Achilleas Pipinellis
parent 5fb044b055
commit cc34f7402e
No known key found for this signature in database
GPG key ID: A0996FBD3E92C17B

View file

@ -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
```