Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to integrate the dotcover HTML reports with sonarqube 4.5?

I have been struggling with this issue. I have been able to generate the HTML reports with the help of DotCover. Also, I have given the path of the reports in the Sonar Portal too under Project Settings--> C# --> CodeCoverage --> DotCoverReportPath and also in the Sonar.Properties file for the particular solution (Mine is a DotNet application).

When I run the Sonar-Runner it seems to parse the HTML files and also says that Execution success, but however my dashboard on the Sonar System shows "No Data" for the coverage.

Please help me out if any of you have faced a similar issue and have been able to figure out the error.

like image 667
user3800964 Avatar asked Nov 03 '14 10:11

user3800964


1 Answers

SonarQube requires that the absolute paths of the source files found in the coverage HTML reports to be strictly equal to the absolute paths of the files being analyzed.

This implies that you cannot run your tests and collect code coverage on a machine A, transfer the report to machine B, and then run the SonarQube analysis from machine B. From within the same machine, you also cannot checkout the code once to run the tests & collect code coverage, and then check it out another time to run the SonarQube analysis.

This is a common case of why code coverage doesn't get imported into SonarQube, but without the logs, it is hard to tell whether this is your case or not.

like image 138
Dinesh Bolkensteyn Avatar answered Oct 05 '22 04:10

Dinesh Bolkensteyn