🤖AI-generated documentation☐ curatedAI Generated
This page was drafted by an AI assistant and may contain inaccuracies.More info about content generation types ↗
About content generation types
🤖
AI Generated — Page drafted entirely by AI from codebase or prompt instructions.
(e.g., docs generated from codebase analysis)
← this page(e.g., docs generated from codebase analysis)
✋→🤖
AI Transformatted — Human provided raw material; AI restructured it into a different format.
(e.g., livestream → blog post, meeting notes → docs)
(e.g., livestream → blog post, meeting notes → docs)
✋
Human Generated — Page written entirely by a human author.
(e.g., hand-written tutorial)
(e.g., hand-written tutorial)
Testing
FreeMoCap uses a multi-layered testing strategy spanning the Python backend, React frontend, and end-to-end integration.
Test Layers
| Layer | Tool | Scope | When to run |
|---|---|---|---|
| Backend unit | pytest | Individual functions, models, utilities | Every commit |
| Backend integration | pytest + httpx | REST endpoints, WebSocket, pipeline startup | Before PR |
| Frontend unit | Vitest (via Vite) | Components, hooks, Redux slices | Every commit |
| E2E | Playwright | Full app (Electron + backend) | Before release |
| Multi-Python | nox | Tests against Python 3.11, 3.12, 3.13 | Before release |
Running Tests
Backend (Python)
# Run all backend tests
uv run poe test
# Run specific test categories
uv run poe test-schema # Pydantic schema validation
uv run poe test-settings # Configuration tests
uv run poe test-http # REST endpoint tests
uv run poe test-ws # WebSocket tests
uv run poe test-sync # Synchronization tests
uv run poe test-calibration # Calibration pipeline tests
uv run poe test-e2e # End-to-end pipeline tests
# Run with nox (tests across Python versions)
nox -s test_all
Frontend (TypeScript)
cd freemocap-ui
# Run frontend tests
npm test
# Run E2E tests (requires Playwright)
npm run e2e
# E2E setup (first time)
npm run pree2e
Linting & Type Checking
# Backend linting (ruff)
uv run poe lint
# Backend type checking (pyright)
uv run poe tc-check
# Auto-fix type-only imports
uv run poe tc-fix
Test File Conventions
Backend
Tests live in freemocap/tests/ mirroring the source structure:
freemocap/tests/
├── test_binary_keypoints_protocol.py
├── test_e2e_pipeline.py
├── calibration/
│ └── test_*.py
└── triangulation/
└── test_*.py
Frontend
Tests co-locate with source files:
freemocap-ui/src/
├── components/
│ └── playback/
│ └── SyncedVideoPlayer.test.tsx
└── store/
└── slices/
└── cameras/
└── cameras-slice.test.ts
E2E Testing
E2E tests use Playwright to drive the full Electron application against a running Python backend. They cover:
- Camera detection and connection
- Recording start/stop lifecycle
- Calibration workflow
- Mocap processing pipeline
- Blender export