Is the generic coverage report parser case sensitive?

480 views
Skip to first unread message

shaun.wilde....@gmail.com

unread,
Dec 18, 2017, 3:06:11 AM12/18/17
to SonarQube
Hi

Trying to upload the coverage files for the c++ part of the project but according to the logs it is being ignored

[exec] 23:52:04.446 INFO: Sensor Generic Coverage Report
[exec] 23:52:04.447 INFO: Parsing C:\projects\opencover\GenericCoverage.xml
[exec] 23:52:04.548 INFO: Imported coverage data for 0 files
[exec] 23:52:04.551 INFO: Coverage data ignored for 34 unknown files, including:
[exec] opencover.profiler/codecoverage.cpp
[exec] opencover.profiler/codecoverage.h
[exec] opencover.profiler/codecoverage_callback.cpp
[exec] opencover.profiler/codecoverage_cuckoo.cpp
[exec] opencover.profiler/codecoverage_profilerinfo.cpp
[exec] 23:52:04.552 INFO: Sensor Generic Coverage Report (done) | time=106ms


Is the generic coverage report parser case sensitive?

thanks

Shaun

nicolas...@sonarsource.com

unread,
Dec 18, 2017, 9:53:33 AM12/18/17
to SonarQube
Hi Shaun,

Yup, it is case sensitive indeed. More broadly speaking keep in mind that SonarQube as a whole operates quite generically on many OS (Linux, Windows etc.), so it therefore definitely is case sensitive when it comes to filepaths.

I suggest you take a closer look on the coverage tool side, and see how to preserve case there.

Best regards,
Nicolas

shaun.wilde....@gmail.com

unread,
Dec 20, 2017, 2:17:16 PM12/20/17
to SonarQube
Hi

I have tweaked the output to preserve case and still, it doesn't work as I hoped

[exec] 10:55:35.628 INFO: Sensor Generic Coverage Report
[exec] 10:55:35.629 INFO: Parsing C:\projects\opencover\GenericCoverage.xml
[exec] 10:55:35.628 WARN: Property 'sonar.coverageReportPaths' is not declared as multi-values/property set but was read using 'getStringArray' method. The SonarQube plugin declaring this property should be updated.
[exec] 10:55:35.729 INFO: Imported coverage data for 0 files
[exec] 10:55:35.731 INFO: Coverage data ignored for 34 unknown files, including:
[exec] OpenCover.Profiler/CodeCoverage.cpp
[exec] OpenCover.Profiler/CodeCoverage.h
[exec] OpenCover.Profiler/CodeCoverage_Callback.cpp
[exec] OpenCover.Profiler/CodeCoverage_Cuckoo.cpp
[exec] OpenCover.Profiler/CodeCoverage_ProfilerInfo.cpp
[exec] 10:55:35.731 INFO: Sensor Generic Coverage Report (done) | time=103ms

Also, my coverage has gotten worse and yet I've made no code changes - just tweaking build settings


the same c# coverage data is also being pushed to coveralls and that is not showing any degradation


I've captured the coverage files as artefacts of my build if anyone can take a look and point me in the right direction


thanks

shaun.wilde....@gmail.com

unread,
Jan 4, 2018, 8:02:42 PM1/4/18
to SonarQube
Can anyone help with the generic coverage files?

nicolas...@sonarsource.com

unread,
Jan 8, 2018, 11:33:26 AM1/8/18
to SonarQube
Hey Shaun, and happy new year,

Given that your project is modular, you need to be careful when using relative paths: Generic Coverage data is imported per module, and relative paths will be looked over from the base directory of each module. You can check the 'Source paths' log (INFO level) to understand which paths are treated by the SonarQube analysis (e.g. under the OpenCover.Profiler module), and then compare that to paths declared in the GenericCoverage.xml .

Generally speaking, as modules are involved, an approach you might opt for (with respect to Generic Coverage data) is to manipulate absolute paths. Those are supported by the Generic Coverage Plugin, and will save you from any confusion with base dir and relative paths.

Makes sense overall ? Have a look at the paths in more details (per guidance here) and let us know how it goes.

Best regards,
Nicolas
Reply all
Reply to author
Forward
0 new messages