chore: enforce local patch coverage as a blocking DoD gate
- Added ~40 backend tests covering uncovered branches in CrowdSec dashboard handlers (error paths, validation, export edge cases) - Patch coverage improved from 81.5% to 98.3%, exceeding 90% threshold - Fixed DoD ordering: coverage tests now run before the patch report (the report requires coverage artifacts as input) - Rewrote the local patch coverage DoD step in both the Management agent and testing instructions to clarify purpose, prerequisites, required action on findings, and blocking gate semantics - Eliminated ambiguous "advisory" language that allowed agents to skip acting on uncovered lines
This commit is contained in:
21
.github/instructions/testing.instructions.md
vendored
21
.github/instructions/testing.instructions.md
vendored
@@ -12,9 +12,19 @@ instruction files take precedence over agent files and operator documentation.
|
||||
|
||||
**MANDATORY**: Before running unit tests, verify the application UI/UX functions correctly end-to-end.
|
||||
|
||||
## 0.5 Local Patch Coverage Preflight (Before Unit Tests)
|
||||
## 0.5 Local Patch Coverage Report (After Coverage Tests)
|
||||
|
||||
**MANDATORY**: After E2E and before backend/frontend unit coverage runs, generate a local patch report so uncovered changed lines are visible early.
|
||||
**MANDATORY**: After running backend and frontend coverage tests (which generate
|
||||
`backend/coverage.txt` and `frontend/coverage/lcov.info`), run the local patch
|
||||
report to identify uncovered lines in changed files.
|
||||
|
||||
**Purpose**: Overall coverage can be healthy while the specific lines you changed
|
||||
are untested. This step catches that gap. If uncovered lines are found in
|
||||
feature code, add targeted tests before completing the task.
|
||||
|
||||
**Prerequisites**: Coverage artifacts must exist before running the report:
|
||||
- `backend/coverage.txt` — generated by `scripts/go-test-coverage.sh`
|
||||
- `frontend/coverage/lcov.info` — generated by `scripts/frontend-test-coverage.sh`
|
||||
|
||||
Run one of the following from `/projects/Charon`:
|
||||
|
||||
@@ -26,11 +36,14 @@ Test: Local Patch Report
|
||||
bash scripts/local-patch-report.sh
|
||||
```
|
||||
|
||||
Required artifacts:
|
||||
Required output artifacts:
|
||||
- `test-results/local-patch-report.md`
|
||||
- `test-results/local-patch-report.json`
|
||||
|
||||
This preflight is advisory for thresholds during rollout, but artifact generation is required in DoD.
|
||||
**Action on results**: If patch coverage for any changed file is below 90%, add
|
||||
tests targeting the uncovered changed lines. Re-run coverage and this report to
|
||||
verify improvement. Artifact generation is required for DoD regardless of
|
||||
threshold results.
|
||||
|
||||
### PREREQUISITE: Start E2E Environment
|
||||
|
||||
|
||||
Reference in New Issue
Block a user