Skip to content

Validate and enforce test coverage requirements #14098

@mx-psi

Description

@mx-psi

Stable components MUST have a max(80%,repository_minimum) coverage.

Currently this is handled and shown in component READMEs via codecovgen.

The remaining sub-tasks are:

  • Make sure code coverage is shown for all components.
  • Introduce a CI check that checks for code coverage requirements on each component and validates against a minimum
    • Right now we only have a minimum for stable components, but to help components transition to stable it may make sense to have some similar requirements for alpha/beta and a metadata.yaml field that can make the required percentage higher than the minimum.
    • Codecov allows you to do this out of the box, but there's a new CI check per component, which is not workable for us, so we will need something custom. Since we are already generating the coverage profiles, we just need to parse that. It seems like go tool cover -func=coverage.out | awk '/^total:/ { print $3 }' works (hacky but does the work)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions