-
Notifications
You must be signed in to change notification settings - Fork 11
Checking for the code coverage
Pablo M. Blanco edited this page Mar 13, 2025
·
3 revisions
pyMBE uses Codecov to analyze the coverage of the code of the module. The code coverage reports are now uploaded to https://app.codecov.io/gh/pyMBE-dev/pyMBE and written to the commit status (green checkmark or red cross).
To run locally the unit tests of pyMBE to check its coverage, first one needs to install the package coverage
:
pip install coverage
Then, one can generate the code coverage report locally with the following commands:
make -j8 unit_tests COVERAGE=1
make coverage_html
xdg-open coverage/index.html
New features require a unit test, otherwise code coverage will drop and CI will fail. Keep in mind that:
- for branches from the pyMBE-dev repository, the secret token is used, and uploads always succeed
- for PRs from forks, the secret token isn't revealed for security reasons, and tokenless mode is used: uploads may fail
- GitHub has a shared pool of free actions for tokenless users; when exhausted, wait for it to refill and re-run job
- action log:
Upload failed: {"detail":"Tokenless has reached GitHub rate limit. Please upload using a token: https://docs.codecov.com/docs/adding-the-codecov-token. Expected available in 358 seconds."}