Hi all,
This is a question to SonarCloud people,
My .coveragerc configuration includes:
[run]
omit =
*/tests/*
Here’s the reference docs: https://coverage.readthedocs.io/en/coverage-4.4.2/config.html
I have confirmed that the resulting cobertura formatted xml file excludes these tests
folders, and any files in them, from the coverage report. We upload them to sonar cloud during a CI pipeline build, and the logs show:
INFO: Python test coverage
INFO: Parsing report '/opt/atlassian/pipelines/agent/build/coverage.xml'
INFO: Sensor Cobertura Sensor for Python coverage [python] (done) | time=161ms
INFO: Sensor PythonXUnitSensor [python]
INFO: Sensor PythonXUnitSensor [python] (done) | time=18ms
I believe I could add this “omit” pattern to ignore test files in our sonar cloud configuration, but that feels redundant, as the coverage.xml file clearly excludes them … maybe we have some sort of cached coverage report for these files? Is there a way to clear it?
Thanks a lot,
Pavel