Update junit_test_reports.md by providing new example for java, using gradle build tool

This commit is contained in:
Maastiff 2018-08-31 19:01:11 +00:00 committed by Achilleas Pipinellis
parent 990278bed9
commit 5fb044b055
No known key found for this signature in database
GPG key ID: A0996FBD3E92C17B

View file

@ -100,3 +100,23 @@ golang:
reports:
junit: report.xml
```
### Java examples
#### Gradle
Use the following job in `.gitlab-ci.yml`:
```yaml
java:
stage: test
script:
- gradle test
artifacts:
reports:
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
path: `build/test-results/test/TEST-*.xml`