Skip to content

Testing

Nick edited this page Jul 28, 2026 · 1 revision

Testing

Open-Write has two test suites: backend (pytest) and frontend (vitest).

Backend Tests

Run all backend tests:

cd backend
uv run pytest

Test Files

File Tests What it covers
test_pipeline.py 5 Word count, manifest, verify, lints, finalize (stdlib only)
test_critics.py 3 Critic composition + hollow-critic round-trip (no network)
test_pipeline_routes.py 12 End-to-end HTTP tests through the real FastAPI router
test_pipeline_outputs.py 27 Output catalog, reader, traversal rejection, control functions
test_orchestrator.py 7 Run-state persistence, phase ordering, manifest build, finalize
test_profile_context.py 7 Profile loading, per-consumer importance routing
test_providers.py Multi-provider routing
test_harness.py Harness layer (planner, router, runner, verifier, reporter)

Running Individual Test Files

Pipeline logic tests are stdlib-only and run without the full backend env:

$env:PYTHONIOENCODING="utf-8"
python tests/test_pipeline.py
python tests/test_critics.py
python tests/test_orchestrator.py
python tests/test_profile_context.py
python tests/test_providers.py
python tests/test_pipeline_outputs.py
python tests/test_harness.py

HTTP routes tests need fastapi + httpx:

python tests/test_pipeline_routes.py

Test Pattern

Tests use an injectable model_call pattern so the pipeline logic is testable without a network key. The orchestrator and critics tests provide canned responses instead of calling real LLMs.

Frontend Tests

cd app
npm run test -- --run

Uses vitest + testing-library with jsdom. Tests live alongside components as *.test.{ts,tsx}.

Typecheck

cd app
npx tsc --noEmit

The tsconfig is strict with noUnusedLocals + noUnusedParameters. Any unused import or local will fail.

Linting

cd backend
uv run ruff check

Manual Smoke Tests

See tests/manual-smoke.md for a checklist of manual scenarios to verify before releases. These cover Tauri-shell flows that can't be automated with unit tests.

Clone this wiki locally