SonarQube Unable to Read CodeCoverage Report for Version

Python Code Coverage is being generated using the following Command
coverage erase; coverage run --branch -m pytest; coverage xml -i -o reports/coverage.xml

Report is Generated and put into Wrote XML report to reports/coverage.xml

Sonar Command is executed to read the Code

sonar-scanner -X '-Dsonar.login=****' '-Dsonar.projectName=gt_sde_demo-container-python' '-Dsonar.projectKey=gt_sde_demo-container-python' '-Dsonar.qualitygate.wait=true' '-Dsonar.host.url=[https://sonarqube.xxxxx](https://xxxxxxx/)' '-Dsonar.java.binaries=.' '-Dsonar.source=.' '-Dsonar.exclusions=Checkmarx/*' '-Dsonar.sourceEncoding=UTF-8' '-Dsonar.coverageReportPaths=reports/coverage.xml' '-Dsonar.qualitygate.timeout=600' '-Dsonar.coverage.dtdVerification=false' '-Dsonar.python.coverage.reportPaths=reports/coverage.xml' '-Dsonar.genericcoverage.reportPaths=reports/coverage.xml' '-Dsonar.python.coveragePlugin=cobertura'

SonarQube is now failing with this error
Error during parsing of the generic coverage report '/home/jenkins/agent/workspace/ontainer-python_feature_DVO-2771/reports/coverage.xml'. Look at SonarQube documentation to know the expected XML format. **11:35:02** Caused by: java.lang.IllegalStateException: **Unknown report version: 6.3.2. This parser only handles version 1**.

coverage command creates the report in cobertura format for XML,
How can we overcome this?
Thanks

I seem to have solved our issue.
The issue being 2 reports were being passed, we removed
Dsonar.genericcoverage.reportPaths=reports/coverage.xml
thanks

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.