Test coverage visualization
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, Self-managed, GitLab Dedicated
With the help of GitLab CI/CD, you can collect the test coverage information of your favorite testing or coverage-analysis tool, and visualize this information inside the file diff view of your merge requests (MRs). This allows you to see which lines are covered by tests, and which lines still require coverage, before the MR is merged.
GitLab supports two coverage report formats:
How test coverage visualization works
Collecting the coverage information is done by using the GitLab CI/CD artifacts reports feature. You can specify one or more coverage reports to collect, including wildcard paths. GitLab then takes the coverage information in all the files and combines it together. Coverage files are parsed in a background job so there can be a delay between pipeline completion and the visualization loading on the page.
Data expiration
By default, the data used to draw the visualization on the merge request expires one week after creation.
Coverage report from child pipeline
If a job in a child pipeline creates a coverage report, the report is included in the parent pipeline’s coverage report.
child_test_pipeline:
trigger:
include:
- local: path/to/child_pipeline_with_coverage.yml
Docs
Edit this page to fix an error or add an improvement in a merge request.
Create an issue to suggest an improvement to this page.
Product
Create an issue if there's something you don't like about this feature.
Propose functionality by submitting a feature request.
Feature availability and product trials
View pricing to see all GitLab tiers and features, or to upgrade.
Try GitLab for free with access to all features for 30 days.
Get help
If you didn't find what you were looking for, search the docs.
If you want help with something specific and could use community support, post on the GitLab forum.
For problems setting up or using this feature (depending on your GitLab subscription).
Request support