Skip to content

Add Codecov integration for patch coverage and per-flag thresholds #307

Description

@pdp2121

The unit-test and integration-test workflows currently gate on overall project coverage via cargo llvm-cov --fail-under-lines. This works but leaves two gaps:

  1. Integration workflow needs a path-exclusion regex to scope its threshold (excluding models/, core/, utils/ etc., which the unit gate already covers). Unit workflow doesn't need this — Cargo features can scope what's compiled — but integration tests must compile everything, so a regex is the only in-tree option.
  2. No patch/diff coverage gate. Today a PR can add new code with low coverage as long as overall % stays above the threshold. A higher bar on new/modified lines specifically is required.

Codecov solves both in one setup:

  • Per-flag thresholds (unit, integration) replace the integration regex — each workflow uploads lcov.info with a flag, Codecov segregates server-side.
  • Built-in patch threshold enforces "new lines must be ≥ X% covered" without affecting legacy code.
  • Inline PR comments showing per-file diff coverage.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions