Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add code coverage to the repo #11

Open
4 tasks
maxrake opened this issue Apr 1, 2022 · 1 comment
Open
4 tasks

Add code coverage to the repo #11

maxrake opened this issue Apr 1, 2022 · 1 comment
Labels
low priority This should be addressed as time permits task Task/chore unrelated to a bug or feature request

Comments

@maxrake
Copy link
Contributor

maxrake commented Apr 1, 2022

Description

Add code coverage to the phylum-dev/phylum-ci repository for the phylum-ci package. This is both for computing code coverage and enforcing it.

Additional Details

  • Compute the code coverage automatically in a workflow
    • The Test workflow is a likely candidate since it could also be the place to fail the build if coverage drops
    • Provide a report as an artifact...even when the build fails
      • HINT: use the always() logic in GHA for this
    • Fail the build if coverage drops below a set threshold
      • Not sure what is normal here...maybe 80% ???
      • Might also be okay to just ensure coverage does not decrease
        • HINT: use the actions/checkout action, ref input to check both the main branch and the current ref to get a diff
  • Expose the ability to compute coverage locally
    • Adding to the test(s) tox environments is a good bet here
  • Consider the pytest-cov package/extension for integrating easily with the existing pytest package

Acceptance Criteria

  • Code coverage is computed automatically in CI
  • Code coverage is available to be computed locally
  • Code coverage is enforced in PRs via failing required checks for minimum coverage threshold
  • Documentation is updated
@maxrake maxrake added low priority This should be addressed as time permits task Task/chore unrelated to a bug or feature request labels Apr 1, 2022
@maxrake maxrake mentioned this issue Apr 22, 2022
6 tasks
@marvin-hansen
Copy link

Sample config for automatic code coverage for Python projects:
Note, this requires a CodeCov API token.

https://github.com/codecov/example-python/blob/main/.github/workflows/ci.yml

Documentation for Python Code Coverage with or w/o PR coverage

https://about.codecov.io/blog/python-code-coverage-using-github-actions-and-codecov/

Usually an increase / decrease in code coverage is reported by CodeCov.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
low priority This should be addressed as time permits task Task/chore unrelated to a bug or feature request
Projects
None yet
Development

No branches or pull requests

2 participants