Files
vercel__workflow/vitest.config.ts
T
Alex Langenfeld d864efb07b test: tighten CI health signals (#4107)
## Summary & Motivation

- Manifest coverage now declares an entry for every matrix app, uses real Vitest skips instead of silent early returns, and fails when a targeted app's manifest is missing, unknown, or unparseable.
- Retries are scoped to deployment e2e runs (`DEPLOYMENT_URL` set), so a flaky unit or integration test can no longer be hidden by a second attempt.
- The stop-workflow cookbook parks on a sleep between iterations, giving the hook an observable barrier to race instead of a fixed delay, and the AbortController hook test waits on queue state rather than a 10ms timer.
- The world-postgres direct-storage fixture drives its run to a terminal state so the conformance worker doesn't recover and replay an unregistered workflow.
- Generated e2e result sidecars are ignored and the committed copies removed; they're CI artifacts, not fixtures.

## Test Plan

Existing coverage runs in CI. With retries disabled: the cookbook agent suite passed 8/8, the two stop-workflow tests passed 10/10, and the AbortController hook replay test passed 25/25 under `CI=1`. The manifest suite skips 52 apps explicitly when nothing is built, and fails on unknown or missing targeted apps. The Docker-backed Postgres spec could not run locally (Testcontainers found no container runtime); `@workflow/world-postgres` typechecks.
2026-09-11 12:39:17 -05:00

32 lines
1.8 KiB
TypeScript

import { configDefaults, defineConfig } from 'vitest/config';
export default defineConfig({
test: {
testTimeout: 60_000,
// Deployment e2e suites can lose timing races to queue delays, cold
// starts, and watcher latency. They always set DEPLOYMENT_URL, so keep
// their one visible retry without masking deterministic unit/integration
// failures elsewhere in `turbo test`. The github-reporter annotates
// retried e2e tests and includes them in the PR summary. Harnesses where
// a failure is itself the signal (event-log-race-repro, benchmarks) pin
// `retry: 0` locally. Local runs also keep retry at 0 for reproduction.
retry: process.env.CI && process.env.DEPLOYMENT_URL ? 1 : 0,
// How many concurrent tests vitest runs from a `describe.concurrent`
// suite (vitest's own default is 5). Only the e2e conformance suite is
// concurrent, so this is effectively its dial. Tunable because the right
// value is a property of the runner and the deployment rather than of
// the tests: every CLI assertion spawns a `node` child, and a CI runner
// has few cores, so too high a value inflates per-test latency until
// tests exceed budgets written for an unloaded suite. Each lane logs
// what it observed (see `summarizeLoad` in the e2e utils).
maxConcurrency: Number(process.env.WORKFLOW_E2E_MAX_CONCURRENCY ?? 5),
// Positional file arguments are regex filters, not paths, so
// `vitest run packages/core/e2e/x.test.ts` also matches
// `.claude/worktrees/<name>/packages/core/e2e/x.test.ts` when agent
// worktrees live inside the repo (see .gitignore). Those copies belong to
// other branches: they would run their own version of the suite against the
// same backend and overwrite the same result files.
exclude: [...configDefaults.exclude, '**/.claude/**'],
},
});