【问题标题】:Code Coverage: .NET Code Coverage and SonarQube VSTS Integration代码覆盖率:.NET 代码覆盖率和 SonarQube VSTS 集成
【发布时间】:2018-01-11 10:17:05
【问题描述】:

有谁知道为什么代码覆盖率不适用于 .NET(完整框架)在 Sonarqube 中集成/发布结果? 这是我的脚本:

@ECHO OFF

MSBuild.SonarQube.Runner.exe begin /k:"CalculatorConsole" /n:"CalculatorConsole" /v:"1.0" /d:sonar.cs.vscoveragexml.reportsPaths="%CD%\VisualStudio.coveragexml"
MSBuild.exe /t:Rebuild


"%VSAPPIDDIR%\..\..\Team Tools\Dynamic Code Coverage Tools\CodeCoverage.exe" collect /output:"%CD%\VisualStudio.coverage"
"%VSAPPIDDIR%\CommonExtensions\Microsoft\TestWindow\vstest.console.exe" "CalculatorConsole.Tests\bin\debug\CalculatorConsole.Tests.dll"

"%VSAPPIDDIR%\..\..\Team Tools\Dynamic Code Coverage Tools\CodeCoverage.exe" analyze /output:"%CD%\VisualStudio.coveragexml" "%CD%\VisualStudio.coverage"

MSBuild.SonarQube.Runner.exe end

运行脚本后,没有发现任何错误,Sonar 中也没有发布代码覆盖率!

【问题讨论】:

  • 您是否查看了 SonarQube 日志(在 debug/trace 上设置 sonar.log.level)?

标签: .net sonarqube sonar-runner sonarqube-scan


【解决方案1】:

如果您使用的是 Visual Studio 2017,SonarQube 最近修复了扫描仪无法通过 Visual Studio 2017 获得代码覆盖率的问题。

这是来自 SonarQube 的问题。 https://jira.sonarsource.com/browse/SONARMSBRU-330

3.0.1 版已于 8 月 3 日发布。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2016-10-29
    • 2014-08-19
    • 1970-01-01
    • 2017-01-25
    • 2021-06-04
    • 2016-06-22
    • 2018-09-02
    • 2015-12-28
    相关资源
    最近更新 更多