I'm working on a Python project on Linux.
I'm trying to link the coverage.xml report to SonarQube analysis.
The project structure is the following:
- root
- folder1
...
- folder2
...
- ...
- coverage.xml
I run the SonarScanner analysis with the following command:
sonar-scanner \
-Dsonar.projectKey=test \
-Dsonar.sources=. \
-Dsonar.host.url=http://localhost:9000 \
-Dsonar.login=xxxxxxxx \
-Dsonar.python.coverage.reportPaths=coverage.xml
Everything works fine except the coverage that it's always not considered.
Here the console output:
INFO: Python test coverage
INFO: Parsing report '/my/path/coverage.xml'
INFO: Sensor Cobertura Sensor for Python coverage [python] (done) | time=73ms
INFO: Sensor PythonXUnitSensor [python]
INFO: Sensor PythonXUnitSensor [python] (done) | time=13ms
INFO: Sensor SonarCSS Rules [cssfamily]
INFO: No CSS, PHP, HTML or VueJS files are found in the project. CSS analysis is skipped.
INFO: Sensor SonarCSS Rules [cssfamily] (done) | time=2ms
INFO: Sensor JaCoCo XML Report Importer [jacoco]
INFO: 'sonar.coverage.jacoco.xmlReportPaths' is not defined. Using default locations:
target/site/jacoco/jacoco.xml,target/site/jacoco-
it/jacoco.xml,build/reports/jacoco/test/jacocoTestReport.xml
INFO: No report imported, no coverage information will be imported by JaCoCo XML Report Importer
INFO: Sensor JaCoCo XML Report Importer [jacoco] (done) | time=9ms
INFO: Sensor JavaXmlSensor [java]
INFO: 1 source files to be analyzed
INFO: Sensor JavaXmlSensor [java] (done) | time=306ms
INFO: 1/1 source files have been analyzed
INFO: Sensor HTML [web]
INFO: Sensor HTML [web] (done) | time=5ms
INFO: Sensor XML Sensor [xml]
INFO: 1 source files to be analyzed
INFO: Sensor XML Sensor [xml] (done) | time=257ms
INFO: 1/1 source files have been analyzed
INFO: ------------- Run sensors on project
INFO: Sensor Zero Coverage Sensor
INFO: Sensor Zero Coverage Sensor (done) | time=12ms
INFO: CPD Executor 21 files had no CPD blocks
INFO: CPD Executor Calculating CPD for 21 files
INFO: CPD Executor CPD calculation finished (done) | time=31ms
INFO: Analysis report generated in 86ms, dir size=397 KB
INFO: Analysis report compressed in 140ms, zip size=133 KB
INFO: Analysis report uploaded in 18ms
INFO: ANALYSIS SUCCESSFUL, you can browse http://localhost:9000/dashboard?id=test
What am I doing wrong?