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.

Roger Oliveira
  • 1,459
  • 1
  • 20
  • 48
  • 1
    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? – Alioza Jun 07 '15 at 04:39
  • 1
    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. – Alioza Jun 07 '15 at 04:46

1 Answers1

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.

Dinesh Bolkensteyn
  • 2,921
  • 1
  • 15
  • 19
  • 1
    For those trying to debug, the full path in the DotCover HTML reports under of the nnn.html files. – MVinca Jan 31 '20 at 14:47