简体   繁体   English

代码覆盖率:.NET代码覆盖率和SonarQube VSTS集成

[英]Code Coverage: .NET Code Coverage and SonarQube VSTS Integration

Does anyone know why Code coverage doesn't work with .NET (full framework) to integrate/publish result in Sonarqube ? 有谁知道为什么代码覆盖无法与.NET(完整框架)集成/发布Sonarqube中的结果? Here my scripts: 这是我的脚本:

@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

After run the script, no errors found and no code coverage published in Sonar! 运行脚本后,在Sonar中没有发现错误,也没有发布代码覆盖!

If you are using Visual Studio 2017, recently SonarQube fixed a issue with the scanner not getting Code Coverage through Visual Studio 2017. 如果您使用的是Visual Studio 2017,则SonarQube最近解决了扫描仪无法通过Visual Studio 2017获得代码覆盖率的问题。

Here is the issue from SonarQube. 这是SonarQube的问题。 https://jira.sonarsource.com/browse/SONARMSBRU-330 https://jira.sonarsource.com/browse/SONARMSBRU-330

Version 3.0.1 was released on August 3rd. 版本3.0.1已于8月3日发布。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM