How to integrate the dotcover HTML reports with sonarqube 4.5?
Asked Answered
P

1

8

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.

Patter answered 3/11, 2014 at 10:44 Comment(2)
What version of dotCover are you using? Have you tried opening the html files after they are generated, are the results correct? Have you looked at the sonar-runner log, is there any potentially useful message there?Execratory
Run the sonar-runner with the -X option to get the debug output if you haven't already, it's helped me many a time.Execratory
C
5

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.

Chanell answered 10/6, 2015 at 12:31 Comment(1)
For those trying to debug, the full path in the DotCover HTML reports under <html><head><title> of the nnn.html files.Adalia

© 2022 - 2024 — McMap. All rights reserved.