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

拜拜、爱过 提交于 2019-12-11 18:07:31

问题


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


回答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.



来源:https://stackoverflow.com/questions/54514090/how-can-one-turn-off-sonar-analyser-but-still-get-coverage-report

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!