SonarQube:从未计算过新代码的覆盖率 [英] SonarQube: Coverage on New Code never calculated

查看:1978
本文介绍了SonarQube:从未计算过新代码的覆盖率的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经设置了SonarQube,Maven和Cobertura,以便在每次构建运行时上传单元测试范围.我想使用差异视图来涵盖增量(仅适用于新代码).

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

coverage本身已成功上传,我可以在代码行中看到增量.但是,我无法使新代码的覆盖范围"起作用.

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.

我尝试了不同的泄漏时间值,包括previous_analysisprevious_version(在新分析中将版本从1.0更改为1.1).我还使用-Dsonar.projectDate来模拟过去的分析日期,但仍然没有运气.

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.

有什么想法吗?

推荐答案

获取与 new_code 相关的信息/指标的关键要求是利用 Git插件 SVN插件等).

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

这篇关于SonarQube:从未计算过新代码的覆盖率的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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