Lost code coverage information when upgrated SonarQube from 6.3 to 6.4

1,222 views
Skip to first unread message

francois...@gmail.com

unread,
Jun 27, 2017, 5:57:12 AM6/27/17
to SonarQube
Hi everyone,

We use the SonarQube VSTS extension to perform code analyses on our C# projects and publish the results to our own instance of SonarQube.

Since I updated our instance from v6.3 to v6.4, we have lost the code coverage information from the analysis reports in SonarQube. I enabled the verbose mode on the scanner to get more info, and got the following message which seems to explain why the code coverage is missing:

2017-06-27T08:14:56.5456207Z 08:14:56.435 DEBUG: 'Generic Coverage Report' skipped because one of the required properties is missing

The log does not indicate which property is missing. I looked at the sources of the GenericCoverageSensor class, and found out that the property is "sonar.coverageReportPaths".

Do you have an idea about what is going wrong here? 

Some info about our configuration:
  • We build and test our projects using VS 2017 or VS 2015.
  • CodeCoverage.exe is installed and run correctly during the build, producing the .coverage and .coveragexml files.
  • The problem does not seem to be linked to the VSTS tasks "SonarQube Scanner for MSBuild". Whether we use version 2 or 3, the reports are still missing the code coverage info.

Thanks in advance. Best regards,


François

Julien HENRY

unread,
Jun 27, 2017, 9:02:48 AM6/27/17
to SonarQube
Hi François,

I think you should not be confused by this log. It comes from the Generic Coverage feature, that is to support "unsupported" coverage reports.

For C# projects, you just have to set the property 'sonar.cs.vscoveragexml.reportsPaths' to tell where is located the .coveragexml file:

But that's strange you loose your configuration after migration from SQ 6.3 to 6.4. Have you also updated the SonarC# plugin at the same time?

++

Julien

francois...@gmail.com

unread,
Jun 28, 2017, 2:50:08 AM6/28/17
to SonarQube
Hi Julien,

Thank you for your quick answer. I managed to get the coverage information back by setting the property "sonar.cs.vscoveragexml.reportsPaths" as you recommended. I gave it the value "**/TestResults/**/*.coveragexml".

At first I set the property in a VSTS build definition (in the "Additional settings" field of the task "Prepare the SonarQube analysis"), but to avoid editing all the build definitions, I modified the file "SonarQube.Analysis.xml" on our build agents and added the following element:

<Property Name="sonar.cs.vscoveragexml.reportsPaths">**/TestResults/**/*.coveragexml</Property>

What's weird is that I never had to manually specify the property "sonar.cs.vscoveragexml.reportsPaths" before. Do you know what could explain this?

And to answer your question, I did update the Sonar C# plugin, which is now in version 6.0.0.2033.

Thanks again,


François

serge....@gmail.com

unread,
Jun 28, 2017, 7:50:28 AM6/28/17
to SonarQube
Hello,

I am experiencing the same issue with TFS on premise and the new SonarQube tasks. Before upgrading to 6.4 (was in 6.2) I did not have to manually specify a value for sonar.cs.vscoveragexml.reportPaths and the coverage results worked fine.
Trying Francois's workaround did the trick but it would be nice to know why we have to do it now.

Julien HENRY

unread,
Jul 7, 2017, 2:02:58 PM7/7/17
to SonarQube, serge....@gmail.com
Hi guys,

Again I'm very surprised this change occurs because of the update of SonarQube. Haven't you also updated the C# plugin at the same time?

++

Julien
Reply all
Reply to author
Forward
0 new messages