Hmm, what do you exactly mean? The visualization is there when you click on “Changes”: [image] The green line next to code marks line was covered by test. There is also a second MR where you can see the red line with code that was not hit by any test. Yes, it’s very subtle and perhaps hard to sp… Answer from paula.kokic on forum.gitlab.com
🌐
GitLab
docs.gitlab.com › gitlab docs › use gitlab › use ci/cd to build your application › testing › code coverage
Code coverage | GitLab Docs
To track code coverage in merge requests, you can display a percentage in the MR widget, annotate individual lines in the MR diff, or both. Each output requires a separate keyword. Configuring one does not enable the other. To get both outputs, configure both keywords.
🌐
GitLab
forum.gitlab.com › how to use gitlab › self-managed
Code Coverage working example - Self-managed - GitLab Forum
February 13, 2024 - Is there a working example of a repo with code coverage report? The repository that is supposed to showcase this feature does not. This is supposed to be a merge request with code coverage: However, it does not show any. The Code Coverage visualization feature does not seem to work in my private ...
Discussions

How to make work View history of project code coverage
How to fix View history of project code coverage I am trying to set up Code coverage | GitLab I am using GitLab v16.0 This is my yaml # .gitlab-ci.yml image: node:12 # Define the stages of the pipeline stages: - test - pages cache: paths: - node_modules/ # Define the job that will run tests ... More on forum.gitlab.com
🌐 forum.gitlab.com
4
0
August 9, 2023
Coverage Confusion
Hi folks, I am trying to get some test coverage information in my project (unfortunately on a private company repo I can not share here) and I am getting a bit confused about what does what. I have Cobertura Reports which I marked as reports: cobertura artifacts in the CI script, but at the ... More on forum.gitlab.com
🌐 forum.gitlab.com
19
0
May 14, 2021
kotlin - What Gitlab tool used for code coverage reports? - Stack Overflow
Instead of using JaCoCo, I was told, that there would be an internal Gitlab tool, where I can create test coverage reports? I do not want to use JaCoCo. I am not interessted in any vizualization p... More on stackoverflow.com
🌐 stackoverflow.com
No code coverage statistics available in repository analytics
Hi everyone 🖐 Problem to solve My code coverage statistics are not showing / are not detected as you can see on the next image: The badge isn’t working as well: Even tho the necessary coverage (and reports) files, are correctly uploaded on my Artifacts: My report is appearing correctly ... More on forum.gitlab.com
🌐 forum.gitlab.com
1
0
February 28, 2025
🌐
GitLab
forum.gitlab.com › gitlab ci/cd
I can't find the test coverage report - GitLab CI/CD - GitLab Forum
July 28, 2021 - I am trying to figure out how to see the test coverage report. I have this public repo. I think I configured it properly, but I don’t know where can I see the integrated coverage report. If I enabled the paths: - htmlcov in the pipeline, I could then download the HTML report generated and I could even see it on GitLab, but as I understand there is also an integrated reporting tool that uses the xml file that was generated.
🌐
Medium
medium.com › @hax.artisan › gitlab-code-coverage-visualization-with-cobertura-9cbf3df8b196
GitLab code coverage visualization with Cobertura | by MingSheng | Medium
September 6, 2024 - With code coverage visualization and integration on GitLab merge requests (MRs), you can view the code coverage in the file diff view just for the commit you have made.
🌐
GitLab
forum.gitlab.com › gitlab ci/cd
How to make work View history of project code coverage - GitLab CI/CD - GitLab Forum
August 9, 2023 - How to fix View history of project code coverage I am trying to set up Code coverage | GitLab I am using GitLab v16.0 This is my yaml # .gitlab-ci.yml image: node:12 # Define the stages of the pipeline stages: - test - pages cache: paths: - node_modules/ # Define the job that will run tests test: stage: test script: - npm install - npm run test -- --coverage --verbose artifacts: when: always paths: - junit.xml - coverage/cobertura-coverage.xm...
🌐
GitLab
forum.gitlab.com › gitlab ci/cd
Coverage Confusion - GitLab CI/CD - GitLab Forum
May 14, 2021 - Hi folks, I am trying to get some test coverage information in my project (unfortunately on a private company repo I can not share here) and I am getting a bit confused about what does what. I have Cobertura Reports which I marked as reports: cobertura artifacts in the CI script, but at the ...
Find elsewhere
🌐
GitHub
github.com › diffblue › gitlab › blob › master › doc › ci › testing › test_coverage_visualization.md
gitlab/doc/ci/testing/test_coverage_visualization.md at master · diffblue/gitlab
The following .gitlab-ci.yml example for Java or Kotlin uses Maven to build the project and JaCoCo coverage-tooling to generate the coverage artifact. You can check the Docker image configuration and scripts if you want to build your own image. GitLab expects the artifact in the Cobertura format, so you have to execute a few scripts before uploading it. The test-jdk11 job tests the code and generates an XML artifact.
Author: diffblue
Top answer
1 of 2
5

the question is what part of Coverage you want to see/have:

  • just a number within the MR - therefore GitLab parses the logoutput of the Jobs
  • coverage visualization within MR - therefore you need to provide a report.

Coverage in Overview

For the coverage in the Overview and just to get a percentage, you need to configure your job with an regex how it can be parsed like

job1:
  # ....
  coverage: '/Code coverage: \d+\.\d+/'

https://docs.gitlab.com/ee/ci/yaml/#coverage

Visualization

We are actually using JaCoCo, but to make the coverage visible and to have the information in Merge Requests you have to convert everything into Cobertura Reports.

There are different approaches to achieve this:

  1. with a gradle-plugin like https://github.com/kageiit/gradle-jacobo-plugin

    the configuration is pretty neat, and if you do have already a gradle build it is easy to integrate

  2. with an own step within the CI Pipeline - see https://docs.gitlab.com/ee/user/project/merge_requests/test_coverage_visualization.html

    test-jdk11:
       stage: test
       image: gradle:6.6.1-jdk11
       script:
         - 'gradle test jacocoTestReport' # jacoco must be configured to create an xml report
       artifacts:
         paths:
           - build/jacoco/jacoco.xml
    
     coverage-jdk11:
       # Must be in a stage later than test-jdk11's stage.
       # The `visualize` stage does not exist by default.
       # Please define it first, or chose an existing stage like `deploy`.
       stage: visualize
       image: registry.gitlab.com/haynes/jacoco2cobertura:1.0.7
       script:
         # convert report from jacoco to cobertura, using relative project path
         - python /opt/cover2cover.py build/jacoco/jacoco.xml $CI_PROJECT_DIR/src/main/java/ > build/cobertura.xml
       needs: ["test-jdk11"]
       artifacts:
         reports:
           cobertura: build/cobertura.xml
    

important to note is that you always will have to tell GitLab CI your path to the artifact for cobertura with

job:
    #...
    artifacts:
      reports:
        cobertura: build/cobertura.xml
2 of 2
0

Our approach is the following. have to tell Gitlab where your coverage report is, for example we have this setup for a java unit test report "jacoco.xml":

 Unit Test:
      stage: pruebas 
      script:
        - echo "Iniciar Pruebas"
        - mvn $MAVEN_CLI_OPTS test
      artifacts:
        when: always
        reports:
          junit: 
            - target/surefire-reports/*Test.xml
            - target/failsafe-reports/*Test.xml
          cobertura: target/site/jacoco/jacoco.xml

Our summary in Gitlab :

Unit Test Detaills:

The key is your "jacoco.xml".

🌐
GitLab
gitlab.com › gitlab.org › gitlab foss › repository
doc/ci/testing/code_coverage.md · v16.1.0 · GitLab.org / GitLab FOSS · GitLab
GitLab FOSS is a read-only mirror of GitLab, with all proprietary code removed. This project was previously used to host GitLab Community Edition, but all development...
🌐
GitLab
forum.gitlab.com › gitlab ci/cd
No code coverage statistics available in repository analytics - GitLab CI/CD - GitLab Forum
February 28, 2025 - Hi everyone 🖐 Problem to solve My code coverage statistics are not showing / are not detected as you can see on the next image: The badge isn’t working as well: Even tho the necessary coverage (and reports) files, are correctly uploaded on my Artifacts: My report is appearing correctly on my merge request.
🌐
GitLab
forum.gitlab.com › gitlab ci/cd
Code coverage visualisation in Merge Requests - GitLab CI/CD - GitLab Forum
November 2, 2020 - Replace this template with your information Readin https://docs.gitlab.com/ee/user/project/merge_requests/test_coverage_visualization.html it looks like it is possible to make use of code coverage visualisation in merge requests. Unfortunately, I can’t get any coverage report in my MRs.
🌐
Visual Studio Marketplace
marketplace.visualstudio.com › azuredevops
Extensions for Visual Studio family of products | Visual Studio Marketplace
One place for all extensions for Visual Studio, Azure DevOps Services, Azure DevOps Server and Visual Studio Code. Discover and install extensions and subscriptions to create the dev environment you need.
🌐
Riccardo Padovani
rpadovani.com › gitlab-code-coverage
Fail a Gitlab pipeline when code coverage decreases
November 18, 2020 - It uses alpine as base, and curl and jq to query the APIs and read the code coverage. On self hosted instances, or on Gitlab.com Bronze or above, you should use a project access token to give access to the APIs. On Gitlab.com Free, use a personal access token.
🌐
CIS Center for Internet Security
cisecurity.org › insights
CIS Benchmarks®
GitLab (1.0.1) To further explore this Benchmark, click here. If you want to tailor the security recommendations of this Benchmark, you can do so using a CIS SecureSuite Membership · Download The Benchmark · Available versions include: Sophos Firewall v22 (1.0.0) Sophos Firewall v21 (1.0.0) To further explore this Benchmark, click here.
🌐
GitLab
about.gitlab.com › blog › engineering › publish code coverage report with gitlab pages
Publish code coverage report with GitLab Pages
November 3, 2016 - Follow the documentation about how to use GitLab Pages. ... image: ruby:2.3 rspec: stage: test script: - bundle install - rspec artifacts: paths: - coverage/ pages: stage: deploy dependencies: - rspec script: - mv coverage/ public/ artifacts: paths: - public expire_in: 30 days only: - master · A job that is meant to publish your code coverage report with GitLab Pages has to be placed in the separate stage.
🌐
Zed
zed.dev › extensions
Zed — Extensions
Choose from the hundreds of extensions to enhance your Zed experience.
🌐
Kiro
kiro.dev › autonomous-agent
Web - Kiro
15 hours ago - In the context of development, agentic development means the AI can take a high-level task description, figure out the implementation plan, write code across multiple repositories, run tests, and create pull requests—all while you work on other things. The agent operates asynchronously in the background rather than requiring you to stay in an active session. Kiro Web is where you build, delegate, and steer development work with Kiro from your browser. Connect your GitHub or GitLab repositories or both, describe what you need, and Kiro writes code, coordinates changes across repos, and opens pull requests.
🌐
Cursor
cursor.com › marketplace
Cursor Marketplace | Cursor Plugins
Covers project initialization, action scaffolding, React Spectrum UI scaffolding, Jest unit and integration testing, Playwright E2E testing, and GitHub Actions / Azure DevOps / GitLab CI deployment pipelines. ChatPRDProduct requirements in your editor. Write PRDs from code context, implement from specs, and verify your changes match requirements — powered by ChatPRD's MCP.
🌐
GitLab
forum.gitlab.com › gitlab ci/cd
How to trigger Coverage badge and Test Coverage Visualization with cobertura coverage xml? - GitLab CI/CD - GitLab Forum
January 18, 2022 - I’m trying to trigger proper coverage badge generation and test coverage visualization for one of my pet project. This is my current config file. I have successfully generated a Cobertura format xml for my coverage that stores in tests/_output/cobertura.xml.