Keep unit tests for
- Pure logic: parsers, validators, state machines, and status engines.
- Money and time math: currency rounding, time zones, and DST boundaries.
- Security and auth boundaries: token verifiers, permission checks, app-coordination and session gates, route auth wrappers, and the protected workflow guards.
- Database and RLS contracts: policy and migration checks in the database lane.
Do not add or keep
- Golden or pixel snapshots as the regression signal for copy, spacing, layout, or colour. Use a journey assertion on the visible state instead.
- Source-text scans: reading CSS, workflow YAML, route directories, or message files and matching strings in them.
- Inventory counts: asserting how many routes, pages, apps, or workflows exist.
- Pinned configuration literals such as shard counts, matrix values, and
timeouts. Assert the invariant instead, for example that
--total-shardsequals the matrix length and every shard index is covered once. - Mock-heavy UI tests that rebuild the component tree to check markup.
CI lanes
Playwright suites stay authoritative until the pilot decision in
E2E pilot and Playwright retirement
is applied per suite.
Writing a journey
Journeys live underapps/web/e2e-agent/ and use e2e. Record the trace once,
commit .e2e/cache, and let CI replay it. The setup, fixture identity rules,
and agent MCP workflow are in the
Agentic E2E Framework guide.
Deleting a test
Every deleted test needs one of the following in its commit message:- the name of the journey that now covers the same behaviour, or
- a written reason that no behaviour is lost, with the boundary it guarded.
Rollout
Existing golden, inventory, and source-scan suites are retired in slices. Each slice names the journey or invariant that replaces each deleted test, and its commit carries the review and CI evidence for the lane change.Measuring CI time
Measure wall time per workflow and per job onmain before and after a
change: