From f2999c98c90bafa5e9d7d85ab6e113df1f56fdf8 Mon Sep 17 00:00:00 2001 From: Achilleas Pipinellis Date: Mon, 3 Sep 2018 13:08:08 +0200 Subject: [PATCH] Refactor Java JUnit reports examples --- doc/ci/junit_test_reports.md | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/doc/ci/junit_test_reports.md b/doc/ci/junit_test_reports.md index ff2fdff7a69..6717dd2dad1 100644 --- a/doc/ci/junit_test_reports.md +++ b/doc/ci/junit_test_reports.md @@ -102,9 +102,15 @@ golang: ``` ### Java examples + +There are a few tools that can produce JUnit reports in Java. + #### Gradle -Use the following job in `.gitlab-ci.yml`: +In the following example, `gradle` is used to generate the test reports. +If there are multiple test tasks defined, `gradle` will generate multiple +directories under `build/test-results/`. In that case, you can leverage regex +matching by defining the following path: `build/test-results/test/TEST-*.xml`: ```yaml java: @@ -116,14 +122,11 @@ 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 -path: `build/test-results/test/TEST-*.xml` +#### Maven -### Java example with Maven - -For parsing Surefire and Failsafe test resports use the following job in `.gitlab-ci.yml`: +For parsing [Surefire](https://maven.apache.org/surefire/maven-surefire-plugin/) +and [Failsafe](https://maven.apache.org/surefire/maven-failsafe-plugin/) test +reports, use the following job in `.gitlab-ci.yml`: ```yaml java: