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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With