SonarQube 单元测试成功小部件没有向下钻取 [英] No drilldown from SonarQube Unit Test Success widget

查看:25
本文介绍了SonarQube 单元测试成功小部件没有向下钻取的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们使用 Jenkins 构建 C# 项目,运行单元测试 (NUnit) 和代码覆盖率 (NCover).作为输出,coverage.nccovnunit-result.xml 文件.

We use Jenkins to build C# project, to run unit tests (NUnit) and code coverage (NCover). As output, coverage.nccov and nunit-result.xml files.

Jenkins 触发 SonarQube 分析(SonarQube 5.0.1 和最新的 C# 插件).SonarQube 仪表板显示单元测试覆盖率和单元测试结果,但失败的测试列表不能显示为向下钻取.

Jenkins triggers SonarQube analysis (SonarQube 5.0.1 and up to date C# plugin). The SonarQube dashboard displays unit tests coverage and unit tests results, but list of failed tests cannot be displayed as drilldown.

当用户点击指标时,显示的页面是空的(没有文件列表,没有向下钻取,只有指标).

When user clicks on the metrics, the page displayed is quite empty (no list of files, no drilldown, just the metric).

sonar-project.properties:

sonar.visualstudio.solution=MyProject.sln
sonar.cs.ncover3.reportsPaths=coverage.nccov
sonar.cs.nunit.reportsPaths=nunit-result.xml

单元测试覆盖率指标按预期显示向下钻取.

Unit Tests Coverage metrics display drilldown as expected.

推荐答案

这确实是插件的一个已知限制,这取决于这张票:https://jira.sonarsource.com/browse/SONARCS-657

This indeed is a known limitation of the plugin, which depends on this ticket: https://jira.sonarsource.com/browse/SONARCS-657

据您所知,实现此功能的主要困难是由于单元测试报告不包含返回源代码文件的链接,而仅包含程序集/类型/方法的链接.SonarQube 需要知道要在钻取中显示哪些文件.

For your information, the main difficulty to implement this feature is due to unit test reports not containing links back to the source code files, but only to assemblies/types/methods instead. SonarQube needs to know which files to show in the drilldown.

这篇关于SonarQube 单元测试成功小部件没有向下钻取的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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