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:
<testcase result="fail" name="test_something" filename="somecomponent/TESTS/sometest/tst_something.cpp">
In the logs:
INFO: Processing xUnit report '/home/jenkins/workspace/.../branch/build/report/test_report_something.xml'
WARN: Cannot find the file '/home/jenkins/workspace/.../branch/somecomponent/tests/sometest/tst_something.cpp' in project 'TestProject' with baseDir '/home/jenkins/workspace/.../branch/', skipping
To Reproduce
Steps to reproduce the behavior:
- Move your tests source to an uppercase directory
- Set your
sonar.tests property accordingly
- Update some tests so that they fail or are skipped
- Launch the tests and the SQ analysis
- Watch the logs to find:
WARN: Cannot find the file '<lower cased path>' in projetc <project> with baseDir ...
Expected behavior
- No errror in logs.
- The failed tests and their source are shown in the UI
Desktop:
- OS: Linux
- SonarQube version: 9.2.1.49989
- cxx plugin version: 2.0.6 (build 2921)
- sonar-scanner version: 4.6.2.2472-linux
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)
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.testsproperty 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)