SonarQube Coverage for Branch

匿名 (未验证) 提交于 2019-12-03 01:38:01

问题:

Is it possible to get code coverage details for non-master branches in SonarQube? The only two tabs I see for other branches are Issues and Code. I am running the same Gradle JaCoCo/Sonar commands for each branch:

./gradlew report sonarqube -Dsonar.branch.name=${BITBUCKET_BRANCH} -Dsonar.organization=${SONARQUBE_ORG} -Dsonar.host.url=https://sonarcloud.io -Dsonar.login=${SONARQUBE_KEY} 

I am using PowerMockito so I need the class instrumentation done by the report task.

We are using Java, Gradle, and JaCoCo with Sonar.

回答1:

All metrics are calculated and available for Long-lived Branches, but as you've discovered only Issues and Code are available for Short-lived Branches. The plan is to rectify that "soon" (certainly by the 7.x LTS) but there's currently no fixed E.T.A.

Be aware that if you choose to analyze all your branches as long-lived branches, you'll have to manage cleaning them out of SonarQube manually when they're no longer useful. But short-lived branches are cleaned out automatically after a certain number of days with no new analysis.

UPDATE

Code coverage is available on short-lived branches and PRs in 7.4. Duplication will be available in 7.5.

"Real" Quality Gates... "soon".

UPDATE 11 Mar 19

"Real" Quality Gates starting 7.7



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