I'm working on creating unitest for a django project
I installed sonarqube:
docker run -d --name sonarqube -e SONAR_ES_BOOTSTRAP_CHECKS_DISABLE=true -p 9000:9000 sonarqube:latest
through docker image and sonar-scanner using this command:
docker run -v /home/hind/Desktop/map-manager:/usr/src --network="host" sonarsource/sonar-scanner-cli -Dsonar.host.url=http://localhost:9000/ -Dsonar.login=sqp_e7171bd635104a04d29c523243cf54000946ea7f
and I before that I added coverage to my project , I created 23 unitest and all running well except for one that is failling
I run tests with:
coverage run manage.py run test maps
and when I run the report of the
sonarqube resultcoverage report
and the report is displaying this:
Name Stmts Miss Cover
---------------------------------------------------
app/__init__.py 0 0 100%
app/settings.py 58 10 83%
app/urls.py 12 0 100%
manage.py 13 6 54%
maps/__init__.py 0 0 100%
maps/admin.py 141 62 56%
maps/migrations/__init__.py 0 0 100%
maps/models.py 163 10 94%
maps/templatetags/__init__.py 0 0 100%
maps/tests.py 195 3 98%
---------------------------------------------------
TOTAL 582 91 84%
but in sonar-scanner I get 0.0% coverage and nothing in unittest:

I'd like help figuring out how to get the coverage analyzed and reported as non-zero, like in the command line based results shown above.
Did you set
sonar.python.coverage.reportPathswith the path to your Cobertura-formatted XML file? Is it in your sonar-project.properties file? I don't see you setting it at the command line when you run your Sonar scanner. See https://docs.sonarqube.org/latest/analyzing-source-code/test-coverage/test-coverage-parameters/#python.Please enable DEBUG Sonar scanner logs
sonar.verbose=trueand check your logs for the phraseSensor Cobertura Sensor for Python coverage.For more information, see https://docs.sonarqube.org/latest/analyzing-source-code/test-coverage/python-test-coverage/.
In the future, you should post on https://community.sonarsource.com/, which is where the Sonar devs can respond to you directly.