C++ cli coverage data in xml repo in lowercase
hi @sawilde
was trying to import coverage reports into sonar, i notice that the c++cli paths in report are all lower case, as the c# side all have correct casing. This results that all coverage for those c++cli be ignored in sonar.
for example
`` file path="e:\buildagent1\work\ae1633cf320ebaec\core\teklastructureswpf\teklastructurescli\common_ui_operations_wrapper_cli.cpp"
file path="E:\prod\structures\src\work\Core\TeklaStructuresWPF\TeklaStructuresWPF\Main\MessageHub.cs" ``
this is likely information that comes from the build system however i dont have much control over it.
The information comes from the PDB files, if the paths being added are lower case then that is what OpenCover sees (though I am surprised the c++ compiler would do that)
@jmecosta is it possible to get sonar to change to handle windows case-insensitive files?
Alternatively it may be possible to update the XML file with the correct paths by iterating each entry and then doing a getfullpath - do you have a sample project I can use to test this approach (saves the effort of making my own to repeat the issue)
@sawilde as far as i remember casing in sonar has always been chalenging to work with, mostly because java is case sensitive. and they dont want to add complexity on top to support case insensitive (on windows). on the cxx plugin: https://github.com/SonarOpenCommunity/sonar-cxx/blob/master/cxx-sensors/src/main/java/org/sonar/cxx/sensors/utils/CxxReportSensor.java#L210 we have used this to normalize the paths before sending them to platform.
-> problem is that if you want to use this: https://docs.sonarqube.org/display/SONAR/Generic+Test+Data then you really need to make sure the paths are all normalized. I have created this https://github.com/jmecsoftware/OpenCover2SonarConverter to make sure we are able to import condition coverage using the generic sonar coverage. We could run the getfullpath there, but i think it would be nicer if the opencover xml would already give the case sensitive data.
in attachment a sample with report inside with the lower case paths in results.xml ClassLibrary1.zip
@jmecosta I am concerned that if I change OpenCover to publish case insensitive paths then other coverage reporting tools may also fail because they use the paths as-is and would get confused by the lack of case.
I think the correct wording is provide reports with correct path casing, right? I think in this case the other tools would just behave as before?
So pretty much like get a proper case capitalization for paths. Besides it seems that the pdb for c# code contains the proper casing it's just the c++cli that creates those lower path, that I am ensure why do they do that.
On Sun, 16 Apr 2017, 13:25 Shaun Wilde, [email protected] wrote:
@jmecosta https://github.com/jmecosta I am concerned that if I change OpenCover to publish case insensitive paths then other coverage reporting tools may also fail because they use the paths as-is and would get confused by the lack of case.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/OpenCover/opencover/issues/674#issuecomment-294344546, or mute the thread https://github.com/notifications/unsubscribe-auth/AA_jyCRKP3SQp8hMhRHKhPInfaPgrnL3ks5rweyNgaJpZM4MygJI .
I think in this case the other tools would just behave as before?
but we can't guarantee that by default so the only other solution is to have a command line switch that would control the case of the filepath names.
command line switch as always a good safe approach, vote up for that :)
On Sun, 16 Apr 2017 at 13:37 Shaun Wilde [email protected] wrote:
I think in this case the other tools would just behave as before?
but we can't guarantee that by default so the only other solution is to have a command line switch that would control the case of the filepath names.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/OpenCover/opencover/issues/674#issuecomment-294345004, or mute the thread https://github.com/notifications/unsubscribe-auth/AA_jyMJqyT8de9fJc1vohB6Abcpcd5nqks5rwe9UgaJpZM4MygJI .
To get the cased form of the name, you have to crawl the directory from the root, and list out the contents. Example code on Stack Overflow for this sort of problem.
@SteveGilham that could work but it does assume you are running the coverage on the same machine where the source is.