-
Notifications
You must be signed in to change notification settings - Fork 362
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Uppercase file paths in Xunit reports are changed to lowercase on case sensitive operating systems #2302
Comments
Hello @jnicol31, thanks for your feedback! I'd have to take a closer look at that. Think the reason was Windows and Visual Studio? On Windows paths are normally case insensitiv and Visual Studio convert always all paths to lower case. sonar-cxx/cxx-sensors/src/main/java/org/sonar/cxx/sensors/tests/xunit/XunitReportParser.java Line 132 in b6a8f3a
Regards, |
Hi @jnicol31, not sure if we need to make it lowercase, inside of sonar-cxx/cxx-sensors/src/main/java/org/sonar/cxx/sensors/tests/xunit/CxxXunitSensor.java Line 126 in b6a8f3a
this seems to be already handled sonar-cxx/cxx-sensors/src/main/java/org/sonar/cxx/sensors/utils/CxxReportSensor.java Line 70 in b6a8f3a
Regards, |
Hi @guwirth, thank you for your feedback. I agree with you. The only use I can see to make it lowercase here is avoiding duplications of test files in Windows in the sonar-cxx/cxx-sensors/src/main/java/org/sonar/cxx/sensors/tests/xunit/XunitReportParser.java Line 42 in b6a8f3a
if the case of the paths was to be inconsistent, which might throw an exception in sonar-cxx/cxx-sensors/src/main/java/org/sonar/cxx/sensors/tests/xunit/CxxXunitSensor.java Line 132 in b6a8f3a
or distort statistics if a file was to be saved twice. I wonder whether |
Hi @jnicol31, thanks for your proposal, also think using path is the better choice: Regards, |
Great ! I will submit a pull request in the next few days to fix this. Regards, |
Describe the bug
Our tests sources are located in a subdirectory
<subcomponent>/TESTS/<test_dir>
.However, the Xunit sensor expects them to be in
<subcomponent>/tests/<test_dir>
In the end, tests fail to be mapped with their test sources, leading to poor information on the UI.
Example:
In the logs:
To Reproduce
Steps to reproduce the behavior:
sonar.tests
property accordinglyWARN: Cannot find the file '<lower cased path>' in projetc <project> with baseDir ...
Expected behavior
Desktop:
Additional context
The issue seems to be in cxx-sensors/src/main/java/org/sonar/cxx/sensors/tests/xunit/XunitReportParser.java, line 132: why is the resolved path converted to lower case ? (commit 2c2ecbd)
The text was updated successfully, but these errors were encountered: