test(unit): split queue.test.ts and backfill.test.ts into smaller files - #4814
Merged
Conversation
5 tasks
Contributor
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
JSONbored
force-pushed
the
perf/split-oversized-test-files
branch
2 times, most recently
from
July 11, 2026 00:38
a8a829f to
508827b
Compare
queue.test.ts (33,461 lines / 810 tests) and backfill.test.ts (6,874 lines / 236 tests) each ran as one atomic unit under a single vitest worker -- queue.test.ts alone accounted for ~282s (roughly half the wall-clock) of the full coverage run's ~565s duration, since vitest schedules whole test files to workers and can't parallelize within one file. Split each into several files along safe, verified boundaries (no shared mutable state crosses a file boundary; hoisted helper functions used across sections were promoted into each file's shared header). Test count and pass/fail results are identical before and after (810 and 236 tests respectively, all passing) -- verified via `vitest run` on the full old-vs-new file sets. Also fixes two stale comments in src/queue/processors.ts that named the old monolithic queue.test.ts file for a test that moved.
Rebasing onto main picked up #4757 (feat(review): decouple e2e-test-gen auto-trigger and widen checkbox auth), which touched the monolithic queue.test.ts before it was split. That content now lives in queue-5.test.ts, so port the same test changes there: the new autoTrigger opt-in on seedAutoTriggerPr, its three new/updated tests, and the [BETA] badge text update. Verified against main's actual source change (src/queue/processors.ts already carries the [BETA] label) and a full run of all 6 split queue files: 813 tests passing (810 + 3 new).
JSONbored
force-pushed
the
perf/split-oversized-test-files
branch
from
July 11, 2026 00:40
6c8edfe to
56ae5ab
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4814 +/- ##
=======================================
Coverage 94.23% 94.23%
=======================================
Files 442 442
Lines 38845 38845
Branches 14150 14150
=======================================
Hits 36607 36607
Misses 1577 1577
Partials 661 661
🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
test/unit/queue.test.ts(33,461 lines / 810 tests) andtest/unit/backfill.test.ts(6,874 lines / 236 tests) each ran as one atomic unit under a single vitest worker. In a real CI run,queue.test.tsalone accounted for ~282s (~half the wall-clock) of the full coverage run's ~565s duration, since vitest schedules whole test files to one worker and can't parallelize within a file.queue.test.ts->queue.test.ts,queue-2.test.ts,queue-3.test.ts,queue-4.test.ts,queue-5.test.ts,queue-lifecycle-guards.test.ts.backfill.test.ts->backfill.test.ts,backfill-2.test.ts.src/queue/processors.tsthat named the old monolithicqueue.test.tsfor a test that moved.Why
Pairs with #4815 (CI coverage sharding): splitting these two files is what lets the new matrix shards actually balance -- without it, one shard would always be stuck holding a ~5-minute file no matter how many shards exist.
Test plan
npx tsc --noEmitcleannpx vitest runon the old file(s) vs. all new split files: identical test counts and all passing (810/810 for queue*, 236/236 for backfill*)npx vitest run --coverage) green