Skip to content

Checking for the code coverage

Pablo M. Blanco edited this page May 17, 2024 · 1 revision

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). One can generate the code coverage report locally with the following commands:

make unit_tests COVERAGE=1
make coverage_html
firefox 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."}