Skip to main content

Testing

CleverThis uses nox as the test runner for all Python code. JavaScript/TypeScript tests use Vitest via pnpm. Run tests before opening a pull request — the CI pipeline runs the same commands.

Python tests (nox)

List all available nox sessions:

nox -l

Key sessions:

SessionCommandWhat it runs
testnox -s testFull pytest suite (server + cleveractors-core)
test-apinox -s test-apiAPI server tests only
test-actorsnox -s test-actorscleveractors-core tests only
lintnox -s lintruff check + ruff format --check
typechecknox -s typecheckmypy type checking
migratenox -s migrateRun Alembic migrations against the dev DB

Run a specific test file:

nox -s test -- tests/server/test_chat.py

Run with coverage:

nox -s test -- --cov --cov-report=html

JavaScript tests (Vitest)

pnpm test # run all tests
pnpm test:watch # watch mode
pnpm test:coverage # with coverage report

Integration tests

Integration tests start a real local stack (API server + test database) and exercise the full request flow. They are tagged with @pytest.mark.integration and are excluded from the fast unit test runs. Run them with:

nox -s test-integration

Integration tests require Docker (for the test database). They run in CI on every PR but are slower locally.

Coming soon

End-to-end (Playwright) tests for the webapp and Actor execution snapshot tests are being added.