Skip to main content
Version: v2.1.x (v2.1.1)

Test suites

Each test suite lives beside the code it covers. The pages in this folder say what each test file guards and which decision a refactor of that code would undo. Start from the table, open the page for the suite that covers your change, and find the file by its subject heading.

The suites​

SuiteCoversPageCommand
tubematic_core/testsThe package every process shares: migrations, the database helpers, backups, logging, auth, the usage ledger and prices, ids and job paths, and the voice, renderer and mascot rulestubematic-core.mdpython -m pytest tubematic_core/tests
mcp/testsThe MCP server: the agent's tools, the scene-work claim, validate_job and the text-layout auditmcp.mdpython -m pytest mcp/tests
renderer/api/testsThe Flask API, the render gateway, the renderer, the worker, AI review and the publishing clientrenderer-api.mdpython -m pytest renderer/api/tests
onboard/testsThe onboarding wizard, agent install, the Compose overrides, stack control and upgrade.pyonboard.mdpython -m pytest onboard/tests
scripts/testsThe poller and the agent adapters, the release tooling and the CI workflows, the service scripts and the Kasm imagesscripts.mdpython -m pytest scripts/tests
vqa/testsThe helper scripts of the video quality assessment imagevqa.mdpython -m pytest vqa/tests
renderer/remotion/cartoon-tools/audio/testsThe mixing rules of the Cartoon 3D soundtrack enginecartoon-audio.mdpython -m pytest renderer/remotion/cartoon-tools/audio/tests
dashboard/tests/unitReact components, route handlers and lib/ helpers, under vitestdashboard-unit.mdcd dashboard && npm test
dashboard/tests/e2eThe dashboard in a real browser against a Docker test stack, under Playwrightdashboard-e2e.mdcd dashboard && npm run test:e2e
renderer/remotionPure helpers of the Remotion project (*.test.ts beside the code), under vitestrenderer-remotion.mdcd renderer/remotion && npm test

Run the Python commands from the repository root. Development: Tests owns the set-up each command needs (the packages to install, Node 22, the Docker build behind the Playwright suite) and the two typecheck commands. Where verification belongs says which checks are valid on your machine and which need a container.

CI runs the seven Python suites as one matrix job per directory, and the dashboard unit suite in its dashboard job. The Playwright suite runs on a version tag or a manual dispatch. The remotion job runs the typecheck and does not run that project's vitest suite (Releases: ci.yml).

Run each Python suite on its own​

Run each suite in its own pytest invocation. Suites collected in one run break each other's imports:

  • scripts/tests and renderer/api/tests each have an __init__.py under a parent directory that is not a package, so both claim the top-level package name tests.
  • tubematic_core/tests and mcp/tests have no __init__.py and share two test file names (test_visual_style.py, test_voice_models.py), so pytest imports both files under one module name.
  • mcp/tests fails beside renderer/api/tests and beside vqa/tests. Each of those imports a module named server first (renderer/api/server.py, or mcp/server.py through vqa/stage_script.py), before mcp/tests has pointed the server at a temporary database, so the run stops on the container's database path, /data.

How the guards were checked​

Each guard described on these pages was verified by removing it from the code and watching a test fail. When you add a guard, do the same before you document it.

Glossary​

TermMeaning on these pages
PinA test pins a value, a wording or a piece of source text when it fails as soon as that thing changes. Tubematic also pins a choice to a video, by writing the resolved agent, model or voice on its row
Negative controlA test of the case that must stay allowed, kept beside the tests of a refusal. It fails when the check starts to refuse too much
Fail openWhen the check itself breaks, the work goes on. AI review and the text-layout audit fail open
Fail closedWhen the check cannot decide, it refuses. The upgrade's removed-component check fails closed
The claimOne of two locks. The scene-work claim gives one agent session a video's scene work. The render claim gives one renderer a queued video
The leaseThe time a render claim holds its video. Each heartbeat extends it (Leases)
The holdOne of two flags. videos.auto_pilot_hold keeps Auto Pilot from scheduling a video again (Stopping one video). render_claim_hold_until stops the built-in renderer's claims while the gpu step recreates it (The Compose override)
LaneOne of the four kinds of agent session the poller runs side by side: pipeline, research, script profiles, mascots (The four lanes)
The deckThe shuffled list of agent ids that new videos are dealt from, by weight (Assignment)
SeedA curriculum seed is a domain that curriculum topics are enumerated from (Where topics come from). To seed a value is to copy a default onto a new row, such as a domain's default voice onto a new video
FrozenA per-video choice is frozen when a write to it is refused because the video is outside the statuses where it may be set (Frozen choices)

Writing these pages​

Every page uses one entry per test file, grouped under headings by subject:

### `test_x.py`

Covers <the code under test, by symbol or file>.

- <One behaviour group the file guards.>
- <Another. Two to five bullets, one per group of behaviour.>

Trap: <the decision a refactor would undo, and what goes wrong when it does>

Needs: <a real process, a binary or a skip condition, when it is not obvious>
  • Say what the file guards and why. The test names carry the inputs, the status codes and the cases, so leave them out.
  • Write a Trap: line when a test protects a decision that looks wrong or that someone might reverse. State the decision and its consequence in one to three sentences. The account of how it was found belongs in the commit message.
  • Where a developer page explains the mechanism, name the rule in a clause and link to that page.
  • Write no test counts. They are wrong after the next commit.
  • Give every test file one entry, and remove the entry when the file goes. Update the page in the same commit as the test, as Keeping the docs true requires.