Testing
There is no monorepo test runner. Each surface owns its own suite, and CONTRIBUTING.md lists exactly what must pass before merge.
Required before merge
| Surface | Command | Notes |
|---|---|---|
apps/server | uv run python manage.py test | Django + DRF unit tests across all apps. Must pass on the PR branch. |
apps/web | npm run lint && npm run build | ESLint + tsc -b + vite build. |
apps/desktop | uv run python -m pytest tests/ | Python + ocap stack. Includes a 5 MB byte-equal loopback through a FastAPI mock server. |
apps/mcp | npm test | 16 unit tests across api / server / http transports. |
apps/cli | npm run build | TypeScript build only for now. |
apps/docs | npm run build | Docusaurus build. Strict mode (onBrokenLinks: 'throw') — broken internal links fail the build. |
packages/schema | no tests | Validation lives in the consumers (apps/server/recording/tests.py, TypeScript compile in clients). |
Cross-surface schema changes touch packages/schema/ and every consumer. After editing events.ts / events.schema.json, verify:
apps/servertests still pass (the schema is loaded at import time).- TypeScript surfaces (
apps/web,apps/mcp,apps/cli) still typecheck.apps/desktopis Python — its consumer ofpackages/schemais the server contract spec atapps/desktop/docs/internals/upload.md, not a typed import.
End-to-end MCP smoke
apps/mcp ships two end-to-end smoke tests that exercise a real Anthropic call:
# stdio transport — spawns dist/index.js as a child process.
export CLONE_API_URL=http://localhost:8001
export CLONE_API_TOKEN=<dev key or JWT>
npm run build
npm run test:e2e
# Streamable HTTP transport — points at any deployed URL.
export CLONE_MCP_URL=https://clone.is/mcp
export CLONE_API_TOKEN=<prod key or JWT>
npm run test:e2e:http
These cost real Anthropic tokens, so run them locally or from a release-only CI lane — not on every PR.
CI
GitHub Actions in .github/workflows/ runs the per-surface checks above on every PR. Web and Server deploy automatically on merge to main.
Adding a test
- Server: add a
test*.pyto the relevant app (apps/server/<app>/tests.py) and call it frommanage.py test. - MCP: add a file under
apps/mcp/tests/and use the existingnode:testharness. - Web / Desktop: runtime tests don't exist yet; tighten the type system or add a Playwright pass when the change warrants it.