0
votes

I have configured Jenkins Job for Sonar Quality Gate and Code Coverage. Below is the Jenkins job set Up. When I trigger the build I see below error. Most of my Jenkins jobs are failing because of this issue. Please help me out from this.

Jenkins Job setup

Error Logs

    ERROR: Error during SonarQube Scanner execution
java.lang.IllegalStateException: Error at line 2 of coverage report C:\Location.xml
    at org.sonar.plugins.coverage.generic.GenericCoverageSensor.loadReport(GenericCoverageSensor.java:130)
    at org.sonar.plugins.coverage.generic.GenericCoverageSensor.analyseWithLogger(GenericCoverageSensor.java:95)
    at org.sonar.plugins.coverage.generic.GenericCoverageSensor.analyse(GenericCoverageSensor.java:91)


at org.sonar.plugins.coverage.generic.ReportParser.parse(ReportParser.java:82)
    at org.sonar.plugins.coverage.generic.GenericCoverageSensor.loadReport(GenericCoverageSensor.java:126)
    ... 31 more
ERROR: 
ERROR: Re-run SonarQube Scanner using the -X switch to enable full debug logging.
The SonarQube Scanner did not complete successfully
21:44:09.12  Creating a summary markdown file...
21:44:09.122  Post-processing failed. Exit code: 1
1

1 Answers

0
votes

The answer is there in the log: org.sonar.plugins.dotnet.tests.ParseErrorException: Missing root element 'test-results' in C:\UC\ProductEligibility\BTS\results.xml at line 2

So the results.xml is not valid xml and causes a parse error and kills the analysis. So whatever creates that file, is causing the issue in the end.

Try to remove that parameter to verify if the analysis runs correctly now.