docs: add CI workflow and testing requirements documentation
- 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>
This commit is contained in:
39
Docs/Testing-Requirements.md
Normal file
39
Docs/Testing-Requirements.md
Normal file
@@ -0,0 +1,39 @@
|
||||
# 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
|
||||
|
||||
```bash
|
||||
cd backend
|
||||
pytest --cov=app --cov-report=term-missing
|
||||
```
|
||||
|
||||
## Coverage Reports
|
||||
|
||||
- Terminal: `--cov-report=term-missing`
|
||||
- HTML: `--cov-report=html` (output in `htmlcov/`)
|
||||
|
||||
## Coverage Badge
|
||||
|
||||
Add to README once CI runs successfully:
|
||||
|
||||
```md
|
||||
[](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 §9` for detailed testing guide
|
||||
Reference in New Issue
Block a user