108 lines
3.1 KiB
Markdown
108 lines
3.1 KiB
Markdown
---
|
|
description: "Run full test suite: backend unit tests, frontend vitest, coverage reports. Use as final verification gate."
|
|
handoffs:
|
|
- label: "Fix Test Failures"
|
|
agent: "fullstack-coder"
|
|
prompt: "Fix the following test failures from the full test suite run. Review the error output and implement fixes."
|
|
condition: "Tests failed"
|
|
- label: "Coverage Deep Dive"
|
|
agent: "qa-tester"
|
|
prompt: "Review the coverage report. Identify uncovered critical paths and propose additional tests."
|
|
condition: "Coverage thresholds not met"
|
|
tools: "bash, grep, read"
|
|
---
|
|
|
|
## User Input
|
|
$ARGUMENTS
|
|
|
|
## Goal
|
|
Run the COMPLETE test suite across both backend and frontend, producing a unified pass/fail + coverage report. This is the **final verification gate** before code review or merge.
|
|
|
|
## Required Skills
|
|
MANDATORY USE `skill({name="semantics-testing"})` — test conventions, anti-tautology rules, tier markers.
|
|
MANDATORY USE `skill({name="molecular-cot-logging"})` — structured logging during execution.
|
|
|
|
## Execution Steps
|
|
|
|
### 1. Pre-flight checks
|
|
```bash
|
|
# Verify venv exists
|
|
ls backend/.venv/bin/activate || echo "MISSING VENV"
|
|
|
|
# Verify node_modules exists
|
|
ls frontend/node_modules/.package-lock.json || echo "MISSING NODE_MODULES"
|
|
```
|
|
If either is missing, report the issue and STOP — do not attempt to install.
|
|
|
|
### 2. Run backend unit tests (Tier 1 — fast)
|
|
```bash
|
|
make test-unit
|
|
```
|
|
Expected: <120s. If tests fail, collect the failure output and handoff to Fix Test Failures.
|
|
|
|
### 3. Run backend integration tests (Tier 2 — Docker required)
|
|
Only if `--run-integration` is passed in $ARGUMENTS:
|
|
```bash
|
|
make test-integration
|
|
```
|
|
Expected: <600s. If Docker is not running or tests time out, report which integration tests passed/failed and continue with partial results.
|
|
|
|
### 4. Run frontend vitest tests (Tier 1 — fast)
|
|
```bash
|
|
make test-frontend
|
|
```
|
|
If tests fail, collect the failure output.
|
|
|
|
### 5. Run E2E tests (optional — requires running app)
|
|
Only if `--e2e` is passed in $ARGUMENTS:
|
|
```bash
|
|
make test-e2e
|
|
```
|
|
|
|
### 6. Generate coverage reports
|
|
```bash
|
|
make coverage
|
|
```
|
|
Review coverage percentages:
|
|
- Backend: check `backend/htmlcov/index.html` or term report
|
|
- Frontend: check `frontend/coverage/index.html`
|
|
|
|
### 7. Linting gate
|
|
```bash
|
|
make lint
|
|
```
|
|
|
|
## Output Format
|
|
```
|
|
## Full Test Suite Results
|
|
|
|
### Backend Unit Tests
|
|
- Total: N | Passed: N | Failed: N | Skipped: N
|
|
- Time: X.Xs
|
|
- [PASS/FAIL]
|
|
|
|
### Backend Integration Tests (if run)
|
|
- Total: N | Passed: N | Failed: N | Skipped: N
|
|
- Time: X.Xs
|
|
|
|
### Frontend Tests
|
|
- Total: N | Passed: N | Failed: N
|
|
- Time: X.Xs
|
|
|
|
### Coverage
|
|
- Backend: XX% (threshold: N/A)
|
|
- Frontend: XX% (threshold: 98% stmts, 95% funcs, 80% branches)
|
|
|
|
### Linting
|
|
- Backend (ruff): [PASS/FAIL]
|
|
- Frontend (eslint): [PASS/FAIL]
|
|
|
|
### Overall: [ALL_PASS / FAILURES_DETECTED]
|
|
```
|
|
|
|
## Constraints
|
|
- NEVER run `pip install` or `npm install` — report missing deps and stop.
|
|
- If a test tier times out, report partial results rather than nothing.
|
|
- For integration tests: if Docker is not available, skip gracefully and note "Docker not available".
|
|
- Respect the anti-loop protocol: at attempt 3, re-check environment; at attempt 4, escalate.
|