Hi,
I have a python project on bitbucket and i use circleci as a CI tool, i have configured sonarscan using the proper steps and all analysis is present but my coverage is always showing 0.0%. I configured the sonar-project.properties files to point to the generated coverage.xml file, and from the sonarscan logs it seems it does find it and parses it. However no coverage is reported for both old and new code. here are details of logs below. and also screenshots.
would really appreciate the help.
Sonarscan logs below acknowledging the presence of coverage.xml
INFO: Python test coverage
INFO: Parsing report '/home/circleci/project/test-reports/coverage.xml'
INFO: Sensor Cobertura Sensor for Python coverage [python] (done) | time=117ms
INFO: Sensor PythonXUnitSensor [python]
INFO: Processing report '/home/circleci/project/test-reports/coverage.xml'
INFO: Sensor PythonXUnitSensor [python] (done) | time=67ms
my sonar-project.properties file
On sonarcloud this is what is reported
from circlici config.yaml this below is my unit test job and sonarscan right below it.
- run:
name: Pytest
command: |
coverage run -m pytest -rap --junitxml=./test-reports/coverage.xml --ignore=./testfolder/tests/testfile.py --ignore=./testfolder/tests/testfile.py --ignore=./testfolder/tests/testfile.py ./testfolder/tests/
coverage xml -i
- persist_to_workspace:
root: ~/
paths:
- project/test-reports/coverage.xml
- store_test_results:
path: ./test-reports
- store_artifacts:
path: ./test-reports
Sonarscan:
executor: angel
steps:
- checkout
- attach_workspace:
at: ~/
- sonarcloud/scan:
sonar_token_variable_name: SONAR_TOKEN
from circleci artifacts it can be seen that coverage is also generated and available
Maybe am missing something