Versions
- SonarQube Server: * Enterprise Edition v2025.2 (105476)
- CI/CD Environment: Azure DevOps
What I’m Trying to Achieve
I’m trying to import test results from a JUnit-style report into SonarQube using the Generic Test Data format during the CI analysis process. The test report is generated and available at:
/home/vsts/work/1/s/packages/core/report/junit-test-report.xml
The Problem
SonarQube fails during analysis with the following error:
##[error]15:04:29.944 ERROR Error during parsing of generic test execution report '/home/vsts/work/1/s/packages/core/report/junit-test-report.xml'. Look at the SonarQube documentation to know the expected XML format.
org.sonar.api.utils.MessageException: Error during parsing of generic test execution report '/home/vsts/work/1/s/packages/core/report/junit-test-report.xml'. Look at the SonarQube documentation to know the expected XML format.
Caused by: java.lang.IllegalStateException: Unknown XML node, expected "testExecutions" but got "testsuites" at line 2
Package.json config
Here is the package.json config that I’m using:
"jest": {
"testResultsProcessor": "jest-sonar-reporter"
},
"jest-junit": {
"outputDirectory": "./report",
"outputName": "junit-test-report.xml"
},
What I’ve Tried
- Verified the report is being generated correctly with
<testsuites>
as the root XML tag (standard JUnit format) - Checked SonarQube documentation for Generic Test Data
- Ensured the report file is being passed to the scanner using:
sonar.testExecutionReportPaths=packages/core/report/junit-test-report.xml
Questions
- Is there a recommended tool or script to convert standard JUnit XML reports to SonarQube’s Generic Test Data format?
- Alternatively, should I be using a different report path property or sensor/plugin if my report uses
<testsuites>
(JUnit format)? - Are there any community-supported integrations that can help with this kind of transformation?