From 5fb044b05528338360c8870589be3ca396c71f3f Mon Sep 17 00:00:00 2001 From: Maastiff Date: Fri, 31 Aug 2018 19:01:11 +0000 Subject: Update junit_test_reports.md by providing new example for java, using gradle build tool --- doc/ci/junit_test_reports.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/doc/ci/junit_test_reports.md b/doc/ci/junit_test_reports.md index 5ae8ecaafa6..9b469938f80 100644 --- a/doc/ci/junit_test_reports.md +++ b/doc/ci/junit_test_reports.md @@ -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` -- cgit v1.2.1