# Coverage gate

A step of the [Open source library](https://gradus.kazet.blog/tree/open-source-library) tree on Gradus, in the Quality bar area: Tests, CI, lint, coverage.

Page: https://gradus.kazet.blog/tree/open-source-library/step/coverage-gate

Measure test coverage in CI and fail when it drops below a threshold, so the public API stays covered.

Usually comes after: [CI across versions](https://gradus.kazet.blog/tree/open-source-library/step/ci-matrix).

## Prompt for your AI assistant

```
Enable coverage reporting in the test runner, publish the report from CI and add a threshold check that fails the build when total coverage drops below the current level minus two percent.
```

Every step of the tree: https://gradus.kazet.blog/tree/open-source-library/llms.txt
