Root Makefile with timeout-protected test targets: - Tier 1 (<30s): make test, make test-unit, make test-frontend - Tier 2 (smart): make test-related F=file.py (via @RELATION BINDS_TO) - Tier 3 (<5min): make test-integration (Docker, --run-integration) - Coverage: make coverage (backend + frontend) - Lint: make lint (ruff + eslint) Smart test selector (scripts/find-related-tests.py): - Extracts module names from #region anchors, class/function defs - Searches 400 BINDS_TO entries across all test files - Confidence scoring: exact > case-insensitive > substring > heuristic - Fallback: filename-based fuzzy matching OpenCode commands: - /test.all — full suite + coverage - /test.unit — fast unit tests (<30s) - /test.related — smart selection by file - /test.coverage — coverage reports with thresholds Speckit workflow updated: - speckit.test.md: raw pytest → make targets with timeout safety - speckit.plan.md: quickstart uses make targets - speckit.tasks.md: verification uses make targets - speckit.implement.md: default stack uses make targets Frontend: added 'coverage' script to package.json
1.8 KiB
1.8 KiB
description, handoffs, tools
| description | handoffs | tools | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Run fast unit tests only (backend SQLite + frontend vitest). Designed for agent verify loop — runs in <30s. |
|
bash, grep, read |
User Input
$ARGUMENTS
Goal
Run ONLY fast unit tests on both backend and frontend. This is the default verification step during development — should complete in <30s with no Docker dependency.
Required Skills
MANDATORY USE skill({name="semantics-testing"}) — test conventions, anti-tautology rules.
Execution Steps
1. Run backend unit tests
make test-unit
This excludes tests/integration/ and uses SQLite in-memory/temp-file databases. No Docker required.
If tests fail:
- Read the failing test file to understand the contract
- Check if the failure is in code you just changed
- Handoff to Fix Test Failures if needed
2. Run frontend unit tests
make test-frontend
This runs vitest with jsdom environment. All SvelteKit imports are mocked.
3. Linting (quick gate)
make lint
Output Format
## Unit Test Results
### Backend (pytest)
- Total: N | Passed: N | Failed: N | Skipped: N
- Time: X.Xs
### Frontend (vitest)
- Total: N | Passed: N | Failed: N
### Linting
- Backend: [PASS/FAIL]
- Frontend: [PASS/FAIL]
### Overall: [PASS / FAIL]
Constraints
- NEVER run
pip installornpm install. - This target MUST complete in <120s (enforced by timeout wrapper).
- If tests time out, report which files passed and which timed out.
- For agent-driven fix loops: run
make test-unitafter every backend change,make test-frontendafter every frontend change.