Test Coverage by Catagory (unit, integration)

Must-share information (formatted with Markdown):

  • which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension)
  • what are you trying to achieve
    I want to view test coverage in three categorizes, unit, integration, and end to end.
  • what have you tried so far to achieve this
    I have read on this forum but I have not found a definitive answer if this is or is not possible.

It looks like this cannot be done according to this thread. Is that the case?

in this thread they suggest using a branch, that would work, but it is pretty kludgy

Thanks for your help

Hey there.

In SonarQube v6.2 , various test-related metrics were integrated into a single “Coverage” metric, as noted in the v6.2 Upgrade Notes

SonarQube 6.2 now has only one type of coverage (MMF-345 - Simplify code coverage support in SonarQube) which merges unit, integration and overall coverage that were badly managed depending on which language(s) and kind of projects you are using. If you had defined quality gate conditions on integration or overall coverage metrics, those quality gates will be automatically updated to use the “default” coverage metric. In this case, you should review those quality gates to make sure that they still represent your requirements.

As a side note, if you were using the Web API to query the overall or integration coverage metrics, you should update your scripts.

The idea really is to have SonarQube as a consolidator of all the possible coverage data you may wish to import (in a flexible/scalable way). That evolution also allows tracking 0 coverage on files that have executable code without associated coverage data. And ultimately it lets each underlying tool reports their specific suite/results in the most suitable manner (and you should consult those reports if you want a more fine-grained view into coverage results).

There’s no specific workaround to recommend to differentiate the two in SonarQube.

This is probably what you read already, so if so, sorry :confused:

Thanks for the confirmation. I just wanted to make sure I wasn’t missing something because I really wanted this feature :slight_smile:

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.