SonarQube project shows "-" as "Code Coverage", even though it shows number of Unit Tests and number of passed,skipped,failed tests successfully

229 views
Skip to first unread message

harshi...@gmail.com

unread,
Jul 10, 2016, 10:44:04 PM7/10/16
to SonarQube
Hi All,

I have an Atlassian Bamboo plan referring to my C# project. The tasks configured are as follows:

a) MSBuild task to build my C# solution file.
b) NUnit Runner and NUnit Parser tasks to run the Unit tests.
c) OpenCover task to execute the NUnit Unit tests and generate the metrics like Lines covered, Branch coverage etc.
d) SonarQube Runner task to generate the code coverage metrics on SonarQube project.

The metrics are successfully generated at step c) and results are written out to .xml file as output of OpenCover command. But after step d), SonarQube runner executes successfully and shows the results on Sonar project in terms of Number of unit tests, tests passed, tests skipped, tests failed. But the Code Coverage column shows as "-" blank.

Please note that my C# solution as multiple projects and I have the sonar-project.properties file at the root (Solution) level.
I use the following Sonar-project.properties file:

sonar.projectKey=XYZ (Key name of  C# project)
sonar.projectName=XYZ (Project name in SonarQube) 
sonar.projectVersion=1.0
sonar.sources=.
sonar.language=cs
sonar.cs.nunit.reportsPaths=XYZ.xml(Output of Nunit task)
sonar.cs.opencover.reportsPath=XYZ.xml(Output of OpenCover task)

Please guide me in this regard, any help will be greatly appreciated.

Thanks
Kumar

harshi...@gmail.com

unread,
Jul 11, 2016, 3:39:57 PM7/11/16
to SonarQube
Hi All,

Please let me know if anybody got a chance to look into this issue? Do let me know if more details are needed so that I can provide the same.

Thanks
Kumar
Reply all
Reply to author
Forward
0 new messages