SonarQube:从未计算过新代码的覆盖率

编程入门 行业动态 更新时间:2024-10-10 09:21:36
本文介绍了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_analysis和previous_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 相关的信息/指标的关键要求是利用 SonarQube SCM集成.要从中受益,您必须安装适用于您的项目的兼容SCM插件(例如 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:从未计算过新代码的覆盖率

本文发布于:2023-10-19 17:27:22,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1508247.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:覆盖率   代码   SonarQube

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!