SonarQube分支机构覆盖率 [英] SonarQube Coverage for Branch

查看:455
本文介绍了SonarQube分支机构覆盖率的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以获取SonarQube中非主分支的代码覆盖率详细信息?对于其他分支,我看到的仅有两个选项卡是IssuesCode.我为每个分支运行相同的Gradle JaCoCo/Sonar命令:

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}

我正在使用PowerMockito,因此我需要报表任务完成的类检测.

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

我们在Sonar中使用Java,Gradle和JaCoCo.

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

推荐答案

所有度量均已计算并可用于寿命长的分支,但是正如您所发现的,

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.

请注意,如果您选择将所有分支都分析为长期存在的分支,则当它们不再有用时,您将不得不从SonarQube中手动清除它们.但是短寿命的分支会在经过一定天数后自动清除,而无需重新分析.

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.

更新
7.4版中的短暂分支和PR均提供代码覆盖.复制将在7.5中提供.

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".

更新19年3月11日
从7.7开始的真实"质量之门

UPDATE 11 Mar 19
"Real" Quality Gates starting 7.7

UPDATE 19 Dec 19
短期和长期分支概念在8.1中仅合并为分支",所有概念都应用了所有度量标准和所有QG条件.

UPDATE 16 Dec 19
Short- and Long-lived branches concepts merged into just "Branches" in 8.1, all of which have all metrics and all QG conditions applied.

这篇关于SonarQube分支机构覆盖率的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆