How can one turn off sonar analyser but still get coverage report?
Asked Answered
R

1

0

It has been cleared here that from Sonarqube version 6.2 that coverage reports are merged and there won't be separate unit and integration coverage report anymore.

We still interested to have these two coverage reports separately. So, We have three sonar projects: unit-tests, integration-tests, whole-project(which is responsible to create overall coverage report)

Problem: All source files are analysed in all three projects. Since the number of files are too many, it takes several minutes to perform the analysis.

Question: Is it possible to turn off sonar issue analyser somehow in a project? It is desired to report only test coverage in the the first two projects(unit-tests & integration-tests) without analysing all files, and then run the issue analyzer only on the last project(whole-project). It could help us to analyse all files once instead of three times.

Additional info: We use sonar gradle plugin version 2.6.2 and sonarqube version 7.4

Refugio answered 4/2, 2019 at 10:21 Comment(0)
R
1

SonarQube/SonarCloud main responsibility is informing users about issues. Displaying code coverage is just an additional feature. It means there is no flag/parameter which allows you to do it.

Luckily, there is a workaround. You can create empty quality profiles, and use them to scan those two projects (unit-tests & integration-tests). You will get 0 issues because there are zero rules enabled.

The following feature request should be interesting for you: Making test coverage measures mode useful. Feel free to vote on it.

Retired answered 4/2, 2019 at 20:50 Comment(2)
Thank you very much for the answer. Firstly, I voted for the feature request. Moreover, I tried run the analysis with an empty quality profile and I got zero issues. But my main concern is about the analysis time that takes around 3 minutes in my case. Unfortunately, it does not matter if we have no rule or several rules the analysis time is still the same.Refugio
Analyzers create classes tree and load libraries even when zero rules are enabled. I don't know if it is possible to disable it. Probably no.Retired

© 2022 - 2024 — McMap. All rights reserved.