Skip to content
Snippets Groups Projects
Verified Commit c730e1ea authored by Panos Kanellidis's avatar Panos Kanellidis :speech_balloon: Committed by GitLab
Browse files

Crosslink to details about multiple reports per job

parent 2006369e
No related branches found
No related tags found
1 merge request!163893Improve Jacoco Docs
......@@ -56,6 +56,8 @@ a [blocking manual job](../../jobs/job_control.md#types-of-manual-jobs), the
pipeline waits for the manual job before continuing and is not considered complete.
The visualization cannot be displayed if the blocking manual job did not run.
If the job generates multiple reports, [use a wildcard in the artifact path](index.md#how-test-coverage-visualization-works)
### Automatic class path correction
The coverage report properly matches changed files only if the `filename` of a `class` element
......
......@@ -13,6 +13,13 @@ DETAILS:
> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/227345) in GitLab 17.3 [with a flag](../../../administration/feature_flags.md) named `jacoco_coverage_reports`. Disabled by default.
[Leave your feedback](https://gitlab.com/gitlab-org/gitlab/-/issues/479804)
FLAG:
The availability of this feature is controlled by a feature flag.
For more information, see the history.
This feature is available for testing, but not ready for production use.
For JaCoCo coverage reports to work, you must generate a properly formatted [JaCoCo XML file](https://www.jacoco.org/jacoco/trunk/coverage/jacoco.xml)
that provides [line coverage](https://www.eclemma.org/jacoco/trunk/doc/counters.html).
......@@ -21,6 +28,10 @@ The JaCoCo coverage reports visualization supports:
- [Instructions (C0 Coverage)](https://www.eclemma.org/jacoco/trunk/doc/counters.html),
`ci` (covered instructions) in reports.
This feature is in [beta](../../../policy/experiment-beta-support.md). If you have any comments,
use the [feedback issue](https://gitlab.com/gitlab-org/gitlab/-/issues/479804)
to provide more details.
## Add JaCoCo coverage job
To configure your pipeline to generate the coverage reports, add a job to your
......@@ -42,8 +53,9 @@ test-jdk11:
```
In this example, the `mvn` command generates the JaCoCo coverage report. The `path`
points to the generated report. You can use only one report per job, and the results
of all jobs are aggregated.
points to the generated report.
If the job generates multiple reports, [use a wildcard in the artifact path](index.md#how-test-coverage-visualization-works)
## Relative File Paths Correction
......
......@@ -138,8 +138,11 @@ artifacts:
path: coverage/cobertura-coverage.xml
```
The collected coverage report is uploaded to GitLab as an artifact. You can use
only one report per job.
The collected coverage report is uploaded to GitLab as an artifact.
You can generate multiple JaCoCo or Corbertura reports within a job and include them in the final
job artifact using [wildcards](../jobs/job_artifacts.md#with-wildcards).
The results of the reports are aggregated in the final coverage report.
GitLab can display the results of coverage report in the merge request
[diff annotations](../testing/test_coverage_visualization/index.md).
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment