I have started using Sonarqube and I have setup a local sonar server to test how it works.
Earlier I used /d:sonar.cs.vscoveragexml.reportsPaths
and generated .coveragexml
file. Now I'm trying to generate .trx
files using MSTest
commands.
So these are the commands I have used to run the sonar analysis.
MSBuild.SonarQube.Runner.exe begin /k:"93ca937be91ab25536462fgdfg566915" /n:"Solution" /v:"1" /d:sonar.cs.vstest.reportsPaths="C:\SonarQube\Solution.trx"
MSBuild.exe "Solution.sln" /t:Rebuild /p:Configuration=Release
MSTest /testcontainer:.\SolutionTests\bin\Release\SolutionTests.dll /resultsfile:"C:\SonarQube\Solution.trx"
MSBuild.SonarQube.Runner.exe end
After running all these commands in a command prompt, it shows code coverage as 0% and shows the no of tests run as 22.
Is there any other command which i am missing to get the code coverage. I understand there is a command something like below :
"C:\Program Files (x86)\Microsoft Visual Studio\2017\TestAgent\Team Tools\Dynamic Code Coverage Tools\CodeCoverage.exe" analyze /output:"C:\SonarQube\Solution.trx"
I'm unable to find the exact command to analyze .trx file. If anyone can help in this matter, it would be very helpful. Many thanks in advance.