I am testing out sonarcloud on one of our smaller projects to determine if it will be purchased for our team. I am just running the scanner locally at the moment. I have run my build and unit testing. The coverage.xml is present, I also added our junit xml to the scanner properties as well. When I run the scanner I get all of my data except coverage. It shows as 0% for all files, even though the coverage is well over 95%.
12:14:23.275 INFO: 6/6 source files have been analyzed
12:14:23.275 INFO: The Python analyzer was able to leverage cached data from previous analyses for 0 out of 6 files. These files were not parsed.
12:14:23.275 INFO: Sensor Python Sensor [python] (done) | time=3001ms
12:14:23.275 INFO: Sensor Cobertura Sensor for Python coverage [python]
12:14:23.276 DEBUG: Using pattern './coverage.xml' to find reports
12:14:23.639 INFO: Python test coverage
12:14:23.640 INFO: Parsing report 'C:\MTRepos\XXXXXX\.\coverage.xml'
12:14:23.698 INFO: Sensor Cobertura Sensor for Python coverage [python] (done) | time=423ms
12:14:23.698 INFO: Sensor PythonXUnitSensor [python]
my properties file looks like this:
sonar.projectKey=XXXXXXX
sonar.organization=XXXXXXX
sonar.host.url=https://sonarcloud.io
# This is the name and version displayed in the SonarCloud UI.
sonar.projectName=XXXX
#sonar.projectVersion=1.0
sonar.python.version=3.11
# Path is relative to the sonar-project.properties file. Replace "\" by "/" on Windows.
sonar.sources=.
sonar.python.coverage.reportPaths=./coverage.xml
sonar.python.xunit.reportPath=./nose2-junit.xml
# Encoding of the source code. Default is default system encoding
#sonar.sourceEncoding=UTF-8
sonar.language=py
sonar.exclusions=**/tests/**, **/venv/**
my coverage xml shows:
<?xml version="1.0" ?>
<coverage version="7.4.0" timestamp="1707327992025" lines-valid="178" lines-covered="178" line-rate="1" branches-valid="36" branches-covered="36" branch-rate="1" complexity="0">
<!-- Generated by coverage.py: https://coverage.readthedocs.io/en/7.4.0 -->
<!-- Based on https://raw.githubusercontent.com/cobertura/web/master/htdocs/xml/coverage-04.dtd -->
<sources>
I have searched through many topics here and none of the suggestions seem to help. Im not sure what to try next.