SonarQube: Coverage on New Code never calculated

时光总嘲笑我的痴心妄想 提交于 2019-12-02 11:47:58

问题


I have set up SonarQube, Maven and Cobertura to upload unit test coverage at every build run. I want to use the differential views to get coverage for the delta (new code only).

The coverage itself is successfully uploaded, and I can see the delta in lines of code. However, I can't get the "Coverage on new Code" to work.

I tried different values for the leak period, including previous_analysis and previous_version (changing the version from 1.0 to 1.1 in the new analysis). I also used -Dsonar.projectDate to simulate a past date of analysis but still no luck.

Any thoughts?


回答1:


The key requirement to obtain new_code -related information/metrics is to leverage SonarQube SCM integration. And to benefit from that you have to install a compatible SCM Plugin applicable to your project (e.g. Git Plugin, SVN Plugin etc.).




回答2:


"Coverage on New Code" is only displayed if you are using/activating SCM support (SVN, Git, ...).

sonar.scm.disabled=false



来源:https://stackoverflow.com/questions/39237636/sonarqube-coverage-on-new-code-never-calculated

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