Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
gitlab-ce
Commits
f2999c98
Commit
f2999c98
authored
Sep 03, 2018
by
Achilleas Pipinellis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactor Java JUnit reports examples
parent
cc34f740
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
8 deletions
+11
-8
doc/ci/junit_test_reports.md
doc/ci/junit_test_reports.md
+11
-8
No files found.
doc/ci/junit_test_reports.md
View file @
f2999c98
...
@@ -102,9 +102,15 @@ golang:
...
@@ -102,9 +102,15 @@ golang:
```
```
### Java examples
### Java examples
There are a few tools that can produce JUnit reports in Java.
#### Gradle
#### 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
```
yaml
java
:
java
:
...
@@ -116,14 +122,11 @@ java:
...
@@ -116,14 +122,11 @@ java:
junit
:
build/test-results/test/TEST-*.xml
junit
:
build/test-results/test/TEST-*.xml
```
```
If you define multiple tasks of kind test, it will generate multiple directories
#### Maven
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`
:
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
```
yaml
java
:
java
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment