- Add GitHub Actions CI pipeline with pytest, ruff, mypy - Expand Tasks.md with implementation tracking and testing criteria - Update CONTRIBUTING.md with CI requirements - Add Testing-Requirements.md with coverage thresholds and PR checks Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
991 B
991 B
Testing Requirements
Coverage Threshold
- Minimum: 80% line coverage for all backend code
- Critical paths (auth, banning, scheduling, API endpoints): 100%
CI Enforcement
.github/workflows/ci.yml runs pytest with --cov-fail-under=80. Build fails if coverage drops below threshold.
Running Tests Locally
cd backend
pytest --cov=app --cov-report=term-missing
Coverage Reports
- Terminal:
--cov-report=term-missing - HTML:
--cov-report=html(output inhtmlcov/)
Coverage Badge
Add to README once CI runs successfully:
[](https://codecov.io/gh/<owner>/BanGUI)
Requires codecov.io integration with repository.
Writing Tests
- Follow pattern:
test_<unit>_<scenario>_<expected> - Mock external dependencies (fail2ban socket, aiohttp calls)
- Test happy path AND error/edge cases
- See
Docs/Backend-Development.md §9for detailed testing guide