2
votes

I'm running a Maven multi-module project, and using Sonar Runner to analyze the project for SonarQube 6.3. This project contains both unit and integration tests in every modules. I succeeded generating reports for UT and IT in target/jacoco-ut.exec and target/jacoco-it.exec. I think analysis parameters for Sonar Runner are good, as I can see both reports are processed and merged during analysis.

  1. From SonarQube 6.3, there's no difference anymore between unit tests and integration tests, though the only measure reported is "Unit tests", which suggests integration tests are ignored.

  2. When I look at the coverage measures in SonarQube, I'm surprised because the number of tests reported is not the sum of the number of unit tests and the number of integration tests. Integration tests are not listed in the measures. To me, if both unit tests and integration tests were merged in SonarQube, I understand there shall both appear in measures, but that's not the case. I can't find anything in SonarQube documentation about integration tests inclusion in measures. There are only notes that they are merged during analysis, though I don't see anything about my integration tests in the coverage measures.

How can I see integration tests and unit tests in coverage measures?

1

1 Answers

1
votes

All tests are now merged into "Coverage", so those numbers include the sum of UT and IT coverage. However prior to the merger there were no metrics about integrations tests themselves (test count, duration, errors, &etc) so there was nothing there to merge.

In fact, metrics about tests (count, errors...) really aren't seen as relevant in general and remain in the system only because they've been grandfathered.