We deploy our pipelines with Jenkins and we just started introducing SonarQube to one of its steps. For one of our full stack projects, we want to report the coverage only for the python backend folder. However, SonarQube keeps raising…
WARN: No report was found for sonar.python.coverage.reportPaths using pattern /tmp/coverage/coverage.xml
Even though, in the tests steps, I can see the following…
Coverage XML written to file /tmp/coverage/coverage.xml
As a result, the project appears with 0% coverage in SonarQuebe dashboard.
I tried setting sonar.verbose=true
but I didn’t find any valuable information. The only thing I could thought was that sonar.python.coverage.reportPaths
can’t handle absolute paths - but it doesn’t make any sense to me. Does somebody have a clue?
Additional info:
- The test step command is something like
cd /opt/project/backend && HOME=/tmp PYTHONPATH=../ COVERAGE_FILE=/tmp/coverage/.coverage pytest --cov=. --cov-report=xml:/tmp/coverage/coverage.xml -s tests/unit
- I have the following in my
sonar-project.properties
file (in the root folder):sonar.sources=backend
sonar.exclusions=terraform/**/plan.json,**/*.test.*
sonar.coverage.exclusions=tests/*,tests_ml_engine/*
sonar.sourceEncoding=UTF-8
sonar.test=backend
sonar.test.inclusions= backend/tests/unit/*
sonar.python.coverage.reportPaths=/tmp/coverage/coverage.xml
- We are deploying Sonarqube with Kubernetes