How to get the desired coverage XML file format by sonarqube

Hello,
Greetings!

First thing first let me share what I am trying to achieve:

I have created xml coverage report with the help of python package coverage==7.4.1

I am facing below error message

Unfortunately, I can’t find any information anywhere in sonarqube documentation.

Here is the execution log

INFO: Parsing D:\empathy-engine-2.0\coverage.xml
INFO: ------------------------------------------------------------------------
INFO: EXECUTION FAILURE
INFO: ------------------------------------------------------------------------
INFO: Total time: 27.208s
INFO: Final Memory: 26M/108M
INFO: ------------------------------------------------------------------------
ERROR: Error during SonarScanner execution
ERROR: Error during parsing of the generic coverage report ‘D:\empathy-engine-2.0\coverage.xml’. Look at SonarQube documentation to know the expected XML format.
ERROR: Caused by: Unknown report version: 7.4.1. This parser only handles version 1.
ERROR: Re-run SonarScanner using the -X switch to enable full debug logging.

I tried with -X also but still did not work.

Any guidance highly appreciated.

Regards,
Bhagwat

It seems like you’re probably apssing your coverage report to sonar.coverageReportPaths by mistake, instead of sonar.python.coverage.reportPaths as documented here

1 Like