We are currently unable to import VSTest results into SQ. Ver used: 7.5
Steps followed in the build tasks:
Have a Prepare Analysis task with the foll. properties:
sonar.cs.vscoveragexml.reportsPaths=**/*.coveragexml
/d:sonar.cs.xunit.reportsPaths="%CD%\XUnitResults.xml"
MS Build task
VSTest task -
with code coverage enabled checked
have a command line script task with foll.:
packages\xunit.runner.console.2.1.0\tools\xunit.console.exe
WrittenNotification.Services.UnitTest\bin\Release\net47\WrittenNotification.Services.UnitTest.dll -xml
XUnitResults.xml
run code analysis task
things verified:
build succeedded
verified the test results file was generated - XUnitResults.xml at the given location
SQ shows number of tests run, but no other details.
From the screen shot, it looks like code coverage information is being imported correctly (i.e. coverage percentage, lines to cover, uncovered lines etc). You should be able to drill down from the Coverage measure to see the individual lines of code that are not covered e.g.
However, we don’t currently show the individual tests that were run, just the number. There is an open issue for this feature that you might want to watch/vote for.