0
votes

I am having a build step in teamcity which runs nunit tests and generates the coverage report using dotcover.

It generates the hidden artifacts having converage report under folder .teamcity/.NetCoverage

I need to set this part to sonar coverage report path sonar.cs.dotcover.reportsPaths, i can see the dotcover files under temp folder, so tried to set the path to

-Dsonar.cs.dotcover.reportsPaths=%system.teamcity.build.tempDir%/

but that is not working, what path should i set for sonar.cs.dotcover.reportsPaths so that the coverage report path is reflected in sonarcube.

1

1 Answers

2
votes

you will need to convert the dotCover report to html format, then only you can import its results in sonar

use something similar to below to convert to html

dotcover analyse /TargetExecutable="c:/Program Files (x86)/Microsoft Visual Studio 12.0/Common7/IDE/mstest.exe" /TargetArguments="my.test.target.dll" /ReportType="HTML" /Output="CoverageReport.html"

and then set the /output value same as sonar.cs.dotcover.reportsPaths value