versions used : ‘Sonar scanner Version2.8’
error observed : Error during parsing of generic test execution report ‘/opt/jenkins/workspace/workspace/Test/xunit.xml’. Look at the SonarQube documentation to know the expected XML format.
steps to reproduce :
Hi, I am currently working on nodejs project and I have installed a ‘mocha-sonarqube-reporter’ npm
to test the nodejs code and generate the xml report
The xml report is getting generated as shown below and is available in the path - ‘/opt/jenkins/workspace/workspace/Test/xunit.xml’
<testExecutions version="1">
<file path="./test/bus-user-IT.js">
<testCase name="TEST Integration test suite: Should onboard business and user" duration="2822"/>
<testCase name="TEST Integration test suite: Session should be in VALIDATION COMPLETE state , Bus and User entities in ACTIVE state" duration="58075"/>
<testCase name="TEST Integration test suite: should submit USER registration request successfully" duration="5011"/>
<testCase name="TEST Integration test suite: Users must be in REGISTERED state" duration="33268"/>
</file>
</testExecutions>
In Jenkins I have added a ‘Sonar scanner Version2.8’ plugin and there was no issue while adding this.
In the jenkins job configuration > ‘Execute Sonarqube Scanner’ > Analysis properties
I have specified the property as : sonar.testExecutionReportPaths=/opt/jenkins/workspace/workspace/$JOB_NAME/xunit.xml
When I do the Jenkins build job, I get the below error
Error during parsing of generic test execution report ‘/opt/jenkins/workspace/workspace/Test/xunit.xml’. Look at the SonarQube documentation to know the expected XML format.
I compared xunit.xml format against the format given in https://docs.sonarqube.org/display/SONAR/Generic+Test+Data
and found the xml format is correct.
Can you plz help me with solution to this problem.
Jenkins build will be success if I remove the property : sonar.testExecutionReportPaths=/opt/jenkins/workspace/workspace/$JOB_NAME/xunit.xml