[P2] Enforce minimum test coverage thresholds in CI #100

Open
opened 2026-07-07 16:22:01 +12:00 by fastie81 · 0 comments
Owner

Problem

CI runs pytest --cov=app but has no --fail-under threshold.

Expected Behavior

Add coverage thresholds:

# In CI test step
run: |
  python -m pytest tests/unit/ tests/e2e/controllers/     --cov=app     --cov-report=term-missing     --cov-report=json:coverage.json     --junitxml=test-results.xml     --fail-under=80  # Fail if coverage < 80%

Targets

  • Unit tests: >90% coverage
  • Overall: >80% coverage
  • Critical paths (auth, payments): >95%
  • .forgejo/workflows/ci.yml (line 70-76)
  • pytest.ini (add fail_under config)
### Problem CI runs `pytest --cov=app` but has no `--fail-under` threshold. ### Expected Behavior Add coverage thresholds: ```yaml # In CI test step run: | python -m pytest tests/unit/ tests/e2e/controllers/ --cov=app --cov-report=term-missing --cov-report=json:coverage.json --junitxml=test-results.xml --fail-under=80 # Fail if coverage < 80% ``` ### Targets - Unit tests: >90% coverage - Overall: >80% coverage - Critical paths (auth, payments): >95% ### Related Files - `.forgejo/workflows/ci.yml` (line 70-76) - `pytest.ini` (add `fail_under` config)
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
fastie81/honbu-manager#100
No description provided.