test: delete 21k low-value tests so CI runs faster and flakes less #49319
main fromrefs/pull/49319/head·merged by t3dotgg(GitHub profile, opens in a new tab) View on GitHub
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
.eachrows, 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_ThreadMessageSearchmalformed-JSON backfill,MobileTelemetry413 body cap,RuntimeRequestService,EventSink,OrchestratorMcpService.schedules, andorchestrator/toolsaction-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.eachrow trims that narrowed inferred row types and broke test typechecks were reverted to keep their full tables.
Follow-on cleanup#
vp run knip:checkis 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, andapps/server/src/testUtils/fakeWsl.tsis removed.- Added
knip.jsoncentries for.github/scripts/test-delta.cjs(run bypr-size.yml) andscripts/mobile-behavior/fake-fx.ts(spawned bymobile-behavior/environment.ts), and dropped the staleknip-schemas.test.tsignore glob. - Removed 3 now-unused devDependencies (
@t3tools/provider-testinginprovider-fxandprovider-kiro,@effect/platform-nodeinprovider-kiro) and syncedpnpm-lock.yaml. - Updated
.github/workflows/ci.yml(node --testlist),apps/mobile/vite.config.ts(reactTestslist), andapps/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.tsin 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 --noEmitacross all 43 packages,vp fmt --check,vp lint --report-unused-disable-directives,vp run knip:check,vp run i18n:check, GraphQLgenerate --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-existingGitManager.test.tsremote_unreachable). - Local before/after on the pre-rebase base, same commands and machine (vitest JSON reporter across all 40 packages):
| Package | Tests before → after | Wall time before → after |
|---|---|---|
| server | 11,328 → 5,902 (-48%) | 2,207s → 1,450s |
| web (unit + browser) | 9,318 → 3,922 (-58%) | 1,933s → 746s |
| mobile | 4,122 → 2,171 (-47%) | 74s → 66s |
| client-runtime | 3,149 → 1,257 (-60%) | 20s → 12s |
| shared | 2,886 → 917 (-68%) | 7s → 6s |
| desktop | 1,394 → 612 (-56%) | 17s → 8s |
| evals | 1,053 → 122 (-88%) | 29s → 25s |
| scripts | 456 → 118 (-74%) | 12s → 6s |
| oxlint-plugin-t3code | 405 → 267 (-34%) | 41s → 16s |
| contracts | 256 → 109 (-57%) | 3s → 2s |
| ssh | 90 → 35 (-61%) | 44s → 6s |
| total (40 packages) | 38,122 → 17,231 (-54.8%) | 4,471s → 2,405s (-46.2%) |
apps/serverhad 0 new failures againstmain(all 12 local failures are the same pre-existingServerBrowserPageandAntigravityDriverfailures from baseline).apps/webunit tests passed 3,267/3,267 (0 failures). All 38 other packages had 0 new failures (scriptshad 3 pre-existing failures vs 7 on baseline).- Local
apps/webbrowser tests hit a pre-existing headless Chromium compositor/requestAnimationFramestall 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
- 2
Pusheda5e8e1a
Pushedf439b15
t3dotgg(GitHub profile, opens in a new tab) closed this
Sign in to join this conversation.
this is the scene where the snap did not work