Skip to main content

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

SurfaceCommandNotes
apps/serveruv run python manage.py testDjango + DRF unit tests across all apps. Must pass on the PR branch.
apps/webnpm run lint && npm run buildESLint + tsc -b + vite build.
apps/desktopuv run python -m pytest tests/Python + ocap stack. Includes a 5 MB byte-equal loopback through a FastAPI mock server.
apps/mcpnpm test16 unit tests across api / server / http transports.
apps/clinpm run buildTypeScript build only for now.
apps/docsnpm run buildDocusaurus build. Strict mode (onBrokenLinks: 'throw') — broken internal links fail the build.
packages/schemano testsValidation 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/server tests still pass (the schema is loaded at import time).
  • TypeScript surfaces (apps/web, apps/mcp, apps/cli) still typecheck. apps/desktop is Python — its consumer of packages/schema is the server contract spec at apps/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*.py to the relevant app (apps/server/<app>/tests.py) and call it from manage.py test.
  • MCP: add a file under apps/mcp/tests/ and use the existing node:test harness.
  • Web / Desktop: runtime tests don't exist yet; tighten the type system or add a Playwright pass when the change warrants it.