Skip to content
Source
Sign inSign up
pingdotgg/t3code

test: delete 21k low-value tests so CI runs faster and flakes less #49319

Mergedt3dotgg(GitHub profile, opens in a new tab)merged 2 commits intomain fromrefs/pull/49319/headmerged by t3dotgg(GitHub profile, opens in a new tab) View on GitHub

t3dotgg(GitHub profile, opens in a new tab)commented
Thanos snap

The test suite doubled again since the last snap (#22557) — up to 2,556 test files and over 1M lines — making CI slow and noisy. Most of the bloat is narrow edge-case regression tests, cosmetic/copy assertions, mock mirrors, and duplicate table rows that burn test time without giving useful signal.

This purges them: about 20,900 of 38,122 executed tests (54.8%). 436 test files are deleted outright and 1,860 more are trimmed (-424k lines). Total suite wall time drops 46% locally, and non-web summed test-file time drops 47%.

How the tests were picked

  • Every test file was inventoried with static signals and baseline timings, then audited in 165 parallel batches against one rubric: delete anything that doesn't name a realistic production bug we would actually fix soon (type-redundant checks, trivial wrappers, copy/styling assertions, mock mirrors, duplicates with a surviving twin, redundant .each rows, exotic inputs, cosmetic edges, and dev-tooling internals). Keep core orchestration and event sourcing, provider protocol translation, auth/permission/secret boundaries, persistence/migrations, git/worktree safety, connection/sync flows, and documented perf/compiler/budget guards.
  • Two over-cut review passes (25 reviewers across 1,651 security/permission/data-loss/browser-cost cuts, plus 4 targeted auditors covering unreviewed sensitive whole-file deletions, migration tests, high-cut core files, and non-JS/eval gaps) restored 78 sole guards (plus 9 more cases from the CI flake ledger audit that had caught real code-fixed bugs in CI, 87 total) (including migration 031_AuthAuthorizationScopes, 081_ProjectionMessageSearchText, 069_ThreadMessageSearch malformed-JSON backfill, MobileTelemetry 413 body cap, RuntimeRequestService, EventSink, OrchestratorMcpService.schedules, and orchestrator/tools action-field validation).
  • Deletions were applied with the TypeScript AST matched by (describe path, title, occurrence), followed by automated unused-wrapper/import/local cleanup and file-header directive restoration. 294 .each row trims that narrowed inferred row types and broke test typechecks were reverted to keep their full tables.

Follow-on cleanup

  • vp run knip:check is clean: ~248 exports only used by deleted tests are un-exported (no production behavior change), ~20 zero-caller test-only declarations and re-exports are deleted, and apps/server/src/testUtils/fakeWsl.ts is removed.
  • Added knip.jsonc entries for .github/scripts/test-delta.cjs (run by pr-size.yml) and scripts/mobile-behavior/fake-fx.ts (spawned by mobile-behavior/environment.ts), and dropped the stale knip-schemas.test.ts ignore glob.
  • Removed 3 now-unused devDependencies (@t3tools/provider-testing in provider-fx and provider-kiro, @effect/platform-node in provider-kiro) and synced pnpm-lock.yaml.
  • Updated .github/workflows/ci.yml (node --test list), apps/mobile/vite.config.ts (reactTests list), and apps/server/src/testUtils/shardWeights.json (213 → 171 entries: dropped deleted/sub-0.5s files and scaled 65 trimmed files by measured speedup).
  • Kept documented guards intact (reactCompilerCoverage.test.ts in web and mobile, bundledDev.test.ts, fileEditorVirtualization.test.ts, transferBudgetV2.integration.test.ts, AgentContextBudget.test.ts, and .github/scripts/stage-preview-bundle.test.py).
  • Reviewed all non-test production edits in parallel to verify zero unintended production behavior changes.

Verification

  • Direct effect-tsgo tsrs --noEmit across all 43 packages, vp fmt --check, vp lint --report-unused-disable-directives, vp run knip:check, vp run i18n:check, GraphQL generate --check, unused-patch lockfile check, React Compiler coverage (2,768/2,768), CI node/python script tests (54 + 6), and all 95 rebased non-browser test files pass on the rebased head (excluding pre-existing GitManager.test.ts remote_unreachable).
  • Local before/after on the pre-rebase base, same commands and machine (vitest JSON reporter across all 40 packages):
PackageTests before → afterWall time before → after
server11,328 → 5,902 (-48%)2,207s → 1,450s
web (unit + browser)9,318 → 3,922 (-58%)1,933s → 746s
mobile4,122 → 2,171 (-47%)74s → 66s
client-runtime3,149 → 1,257 (-60%)20s → 12s
shared2,886 → 917 (-68%)7s → 6s
desktop1,394 → 612 (-56%)17s → 8s
evals1,053 → 122 (-88%)29s → 25s
scripts456 → 118 (-74%)12s → 6s
oxlint-plugin-t3code405 → 267 (-34%)41s → 16s
contracts256 → 109 (-57%)3s → 2s
ssh90 → 35 (-61%)44s → 6s
total (40 packages)38,122 → 17,231 (-54.8%)4,471s → 2,405s (-46.2%)
  • apps/server had 0 new failures against main (all 12 local failures are the same pre-existing ServerBrowserPage and AntigravityDriver failures from baseline). apps/web unit tests passed 3,267/3,267 (0 failures). All 38 other packages had 0 new failures (scripts had 3 pre-existing failures vs 7 on baseline).
  • Local apps/web browser tests hit a pre-existing headless Chromium compositor/requestAnimationFrame stall on this Linux box (521 baseline failures → 187 after); auditors ignored browser timings so no browser test was cut for cost, and CI will verify the full browser suite cleanly.

Created with Claude Fable 5.2 (initial 165-batch audit, over-cut review, and AST purge in Claude Code) and Gemini 4 Neon (follow-on over-cut audit, knip cleanup, verification, rebase, and production-diff review in Antigravity).

    1. Pusheda5e8e1a

    2. Pushedf439b15

    3. this is the scene where the snap did not work

Sign in to join this conversation.