Reputation: 77
Does anyone know why Code coverage doesn't work with .NET (full framework) to integrate/publish result in 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!
Upvotes: 0
Views: 727
Reputation: 31
If you are using Visual Studio 2017, recently SonarQube fixed a issue with the scanner not getting Code Coverage through Visual Studio 2017.
Here is the issue from SonarQube. https://jira.sonarsource.com/browse/SONARMSBRU-330
Version 3.0.1 was released on August 3rd.
Upvotes: 1