This repository was archived by the owner on Nov 4, 2026. It is now read-only.
Repository navigation
Commit 83d4fda
test(scripts): hoist the whole-repository scan out of check-unused-dependencies' timed window (#8543)
The three tests in `check-unused-dependencies.test.ts`'s `this repository` block
each called `analyze(repoRoot)` and then read one field of the result. That is
the same whole-repository walk — 47 manifests, >1000 files — paid for three
times, each pass inside a bounded assertion window.
On the push lane the suite runs under v8 coverage instrumentation, and there a
single pass crosses vitest's 15 s `testTimeout`. All three tests then fail with
`Test timed out in 15000ms` while the gate they exercise is green. Because the
coverage thresholds live only on the merged 4-shard report — the shard legs
override them to zero — one red shard skips the merge and the thresholds are
never evaluated on that commit at all.
Hoist the scan to module scope as `REPOSITORY_SCAN`, where the cost lands in the
import phase that no `testTimeout` governs. Not a `beforeAll`, which would trade
the 15 s `testTimeout` for the narrower 10 s `hookTimeout` — the same reasoning
that moved `check-doc-links.test.ts`'s corpus walk to `ANCHOR_CORPUS`.
No timeout was raised and no assertion was weakened: the three tests read the
same three fields of the same verdict they read before.
Claude-Session: https://claude.ai/code/session_01FhBNJcLRZLe8M87VcUgpKr
Co-authored-by: Claude <noreply@anthropic.com>1 parent 389902e commit 83d4fda
1 file changed
Lines changed: 24 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
374 | 374 | | |
375 | 375 | | |
376 | 376 | | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
377 | 398 | | |
378 | 399 | | |
379 | | - | |
| 400 | + | |
380 | 401 | | |
381 | 402 | | |
382 | 403 | | |
| |||
392 | 413 | | |
393 | 414 | | |
394 | 415 | | |
395 | | - | |
| 416 | + | |
396 | 417 | | |
397 | 418 | | |
398 | 419 | | |
399 | 420 | | |
400 | 421 | | |
401 | 422 | | |
402 | | - | |
| 423 | + | |
403 | 424 | | |
404 | 425 | | |
405 | 426 | | |
| |||
0 commit comments