Skip to content

Display data from cobertura coverage reports in the MR

Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.

Problem to solve

As a developer, I want to see a summary of how coverage changed in an MR, so I can quickly identify where to shore up tests for my change.

Teams want to see a report of code coverage of their projects but the artifact created for parsing today is only available as a downloadable artifact. Code coverage is important to understand how much of your code can be tested automatically. If the coverage is near to 100%, automated unit tests are reaching the goal, otherwise it means they may miss important portions of the applications.

Intended users

Further details

We already support parsing code coverage values from the raw output of the job, but we can do even more. When there is a coverage value for a branch we should also provide a way to see the generated coverage report in the product.

Proposal

  • Use the cobertura report already uploaded and parsed for Test Coverage Visualization.

A first iteration of this may be just to show the report as an job artifact in the MR. Iterations after that may be:

  • Create a minimal view of the data for the source branch in the MR (lines covered, coverage diff for files in the commit, other)
    • This may be part of the existing coverage data on the MR page
    • Screen_Shot_2021-01-06_at_2.25.06_PM
  • Create a view of how coverage changed for files within the MR
  • Create a view of the entire report in GitLab

Permissions and Security

Documentation

Availability & Testing

What does success look like, and how can we measure that?

What is the type of buyer?

Is this a cross-stage feature?

Links / references

Original Write up the issue

Description

Code coverage is important to understand how much of your code can be tested automatically. If the coverage is near to 100%, automated unit tests are reaching the goal, otherwise it means they may miss important portions of the applications.

We already support parsing code coverage values from the raw output of the job, but we can do even more.

Proposal

Detect the language and the tests that the application has, and automatically run the related tool to generate a coverage report.

After that, we can run the Code Climate Test Reporter to convert reports into a common format and show it in the UI.

This is the list of tools/languages supported by cc-test-reporter:

  • Ruby: SimpleCov
  • JavaScript: lcov (generated by Istanbul e.g.)
  • PHP: Clover
  • Go: Cover
  • Python: CoveragePy
  • Java: Cobertura and Jacoco
  • Swift: Cobertuna and gcov (generated by SwiftCov e.g.)
  • C/C++: gcov
  • Scala: Cobertura

*This page may contain information related to upcoming products, features and functionality. It is important to note that the information presented is for informational purposes only, so please do not rely on the information for purchasing or planning purposes. Just like with all projects, the items mentioned on the page are subject to change or delay, and the development, release, and timing of any products, features, or functionality remain at the sole discretion of GitLab Inc.*
Edited by 🤖 GitLab Bot 🤖