Skip to content

Test Runners & Slow Tier

Squeal wraps your existing test runners instead of replacing them. You can combine Vitest, node:test, and pytest side-by-side in a single repository.

Vitest projects are discovered automatically from your repository’s Vitest configuration.

Excluding Vitest projects or build-output tests

Section titled “Excluding Vitest projects or build-output tests”

Squeal does not cover tests that depend on a build artifact it does not produce (such as an end-to-end suite spawning a compiled bundle) or browser projects requiring external servers. Exclude them explicitly so Squeal never reports false staleness or runs them out of date:

{
"vitest": {
"exclude": ["test/e2e/**"],
"excludeProjects": ["browser-e2e"]
}
}

Excluded globs and projects are named explicitly in squeal checks, squeal status, and squeal setup --check as not covered.

If your Vitest config enables deps.optimizer, Squeal runs Vitest without the optimizer because pre-bundled optimizer caches can hold stale copies of source files not tracked in a result’s content key. Squeal notes this in status headers.

Declare one or more node:test projects under nodeTest in squeal.config.json:

{
"nodeTest": [
{
"name": "cli",
"include": ["test/cli/**/*.test.ts"],
"exclude": ["test/cli/manual.test.ts"],
"cwd": ".",
"argv": ["--import", "tsx"],
"env": { "NODE_ENV": "test" }
}
]
}

Key fields:

  • name (required, unique): project identifier.
  • include (required): worktree-relative globs (relative to cwd).
  • exclude, cwd, node, argv, env: optional overrides.
  • slow: set true to place every file in this project into the slow tier.
  • prepare: build command run once by squeal code --base before the project’s tests (see Code Quality Gate). The background daemon skips entries that define prepare.

Declare Python test projects under pytest:

{
"pytest": [
{
"name": "api",
"cwd": "services/api",
"include": ["tests/**/test_*.py"],
"python": ".venv",
"args": ["--ds=settings"],
"batchSize": 5
}
]
}
  • Squeal locates Python via python (relative to cwd, defaulting to .venv then .pdm-python, or an absolute path outside the worktree). It never guesses from an activated VIRTUAL_ENV or ambient PATH.
  • batchSize (default 5) tunes test files per pytest process: higher values amortize startup; lower values isolate session state.

Tests that are too heavy to run after every keystroke (integration suites, multi-second fixtures, end-to-end specs) belong in the slow tier via slow.include (globs across any runner) or "slow": true on a nodeTest / pytest entry:

{
"slow": {
"include": ["test/integration/**/*.test.ts"],
"trigger": "continuous",
"quietMs": 3000,
"maxWorkers": 2,
"maxParallel": 4,
"maxLoadPerCpu": 1.0,
"maxDeferMs": 600000
},
"stop": {
"requireSlowSuite": true,
"slowWaitMs": 120000,
"maxHolds": 1
}
}
  • trigger: "continuous" (default): once an edit’s fast tests finish and no new edit arrives for slow.quietMs (default 3000 ms), slow files start in the background even mid-turn, arriving with the agent’s next tool call.
  • trigger: "idle": slow files wait until the agent pauses (or squeal run --slow is called).
  • Load deferral: if one-minute host load per CPU exceeds slow.maxLoadPerCpu, slow files defer up to slow.maxDeferMs before running anyway.
  • Stop enforcement: with stop.requireSlowSuite: true, the Stop hook waits up to stop.slowWaitMs for uncurrent slow files whenever the session edited files, keeping the agent going on a failure or timeout up to stop.maxHolds times per turn.

Run or wait for slow files explicitly at any time:

Terminal window
squeal run --slow --wait 60000