Hello,
I have integrated SonarCloud in one of our Python / Django project. We use CircleCI and the sonarcloud orb.
When we upload branches on Github & create pull request, CircleCI triggers a build, which run the tests (with coverage), and then run the sonarcloud scanner:
version: 2.1
orbs:
sonarcloud: sonarsource/sonarcloud@2.0.0
...
tests-coverage:
executor: py39
resource_class: large
environment:
COVERAGE_PROCESS_START: ".coveragerc"
steps:
- checkout
- setup
- run: dockerize -wait tcp://localhost:5432 -timeout 10s
- run: coverage run --rcfile .coveragerc app/manage.py test app --failfast --timing --verbosity 3 --parallel=6
- run: coverage combine --rcfile .coveragerc
- run: coverage report --rcfile .coveragerc
- run: coverage xml --rcfile .coveragerc
- sonarcloud/scan
The coverage xml file seems to be correctly detected and uploaded:
INFO: Parsing report '/home/circleci/project/artifacts/coverage/xml/coverage.xml'
INFO: Sensor Cobertura Sensor for Python coverage [python] (done) | time=448ms
...
INFO: Analysis report uploaded in 803ms
INFO: ANALYSIS SUCCESSFUL, you can find the results at: ...
But when looking at the Branch summary, there is no coverage status
I would like to add that the branch in question remove some dead code and adds tests, all of that should result in a (minor) coverage increase.
- path/to/file.py 81 25 14 0 58.9% 80-84, 87-91, 111-137
+ path/to/file.py 73 1 12 1 97.6% 82
- TOTAL 51768 7687 9795 782 81.4%
+ TOTAL 51827 7663 9793 783 81.4%
Everything seems to work on the master branch, but nothing on the other branches.
The pull request opened for this branch doesn’t appear in SonarCloud.
Can you help ?