Skip to content

CI: add coverage threshold once codebase stabilises #31

@koinsaari

Description

@koinsaari

Once the project is past early-stage churn, add a minimum coverage threshold to the unit test job to fail the build on regressions.

Suggested approach

  • Add -coverprofile=coverage.out is already in place (added in CI: run tests with -race and report coverage #19)
  • Use go tool cover -func=coverage.out output to compute total, or use a dedicated action
  • Agree on a threshold (e.g. 70–80%) and enforce with something like:
    go tool cover -func=coverage.out | grep total | awk '{if ($3+0 < 70) exit 1}'
  • Alternatively integrate Codecov for trend tracking and PR comments

When to do this

After the core API endpoints and accessibility engine have stable test coverage — not mid-feature when coverage naturally dips.

Files: .github/workflows/ci.yml

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:ciCI workflow / pipelinearea:testsTest codechoreMaintenance, tooling, deps, CI plumbingpriority:futureFuture / next chapters

    Type

    No fields configured for Task.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions