Hello,
We send two coverage reports to SonarQube in one analysis, one from our unit tests and one from our integration tests, and SonarQube merges them into a single Coverage number. We would like to know whether SonarQube can tell the two apart: in the quality gate metrics, in the file view when looking at a covered line, or through a plugin.
What we are trying to achieve
Our Python service runs two test suites in CI, unit tests and integration tests. Each suite produces its own coverage XML report, and we pass both to one analysis using:
sonar.python.coverage.reportPaths=coverage.xml,coverage-integration.xml
SonarQube merges them into a single Coverage metric. That merged number is what we want for the quality gate, but we would also like to see how much each suite contributes.
Questions
-
Quality gate metrics by coverage type. Is there a way to identify the coverage type (unit or integration) in the quality gate metrics? We would like conditions such as “unit coverage on new code >= X%” and “integration coverage on new code >= Y%”, instead of one merged number.
-
Per line attribution in the UI. When viewing a file, can SonarQube show which report covered a given line (unit, integration, or both)?
-
Plugin. Is there a plugin, from the Marketplace or elsewhere, that adds coverage by report metrics or per line report attribution?
Any pointers to documentation, a setting, or a recommended workaround would be very helpful.
Thanks in advance,
Eman