Skip to content

Add code coverage to the repo #11

Description

@maxrake

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    low priorityThis should be addressed as time permitstaskTask/chore unrelated to a bug or feature request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions