TE

Test Coverage & CI

Enforce test coverage thresholds and run tests in CI pipelines

Details

Language / Topic
_UUniversal
Category
Testing

Rules

balanced
- Run the full test suite in CI on every push and pull request — never merge with failing tests.
- Set coverage thresholds for business-critical code (80%+ for core logic).
- Always run tests locally before pushing — CI is a safety net, not the first line of defense.
- Configure CI to run unit tests first (fast feedback), then integration, then E2E (test pyramid).
- Fail the build when coverage drops below the threshold — prevent gradual test debt accumulation.
- Track coverage trends over time — a declining coverage metric signals a process problem.
- Use test result caching and parallelization to keep CI feedback under 10 minutes.
- Require all tests to pass before merging PRs — no exceptions for "known flaky" tests, fix them instead.