You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
turbo test inputs have the same out-of-package hole #3514 closed for type-check — the root vitest.config.mts every package re-exports is not hashed #4178
Found while implementing #3514 (PR #4176). Filed unassigned; not fixed there because that card is scoped to the type-check task.
The gap
#3514 established the mechanism: turbo hashes a task from its inputs, $TURBO_DEFAULT$ covers only files inside the package directory, and globalDependencies is unset — so any file a task reads from elsewhere in the repo is invisible to the cache key, and turbo replays the previous verdict instead of re-running. CI persists .turbo/cache through actions/cache, so the stale result travels.
The test task has exactly that shape, and every entry in its list is package-relative:
vitest.config.* and vitest.setup.* look like they cover the Vitest configuration, but they resolve inside the package. The files that actually decide how a package's tests run live at the repo root, and every package reaches them:
$ cat packages/core/vitest.config.ts
import rootConfig from '../../vitest.config.mts';
export default rootConfig;
The root vitest.config.mts owns the unit / dom / dom-heavy project split, sharedExclude, the domTsTests and heavyDomTests lists, and the alias table. The four root vitest.setup.* files decide which package graphs are registered before a test renders. None of them is hashed by any package's test task.
Measured
On claude/issue-3514-turbo-inputs-guard, @object-ui/core:
$ npx turbo run test --filter @object-ui/core --dry=json
baseline 2e2087e2c30ef125
after touching root vitest.config.mts 2e2087e2c30ef125 <- frozen
after touching root vitest.setup.base.ts 2e2087e2c30ef125 <- frozen
The cache key does not move. The equivalent measurement on type-check before #4176 produced a FULL TURBO replay in 44ms over a real TS2688, with --force on the same tree exiting 2 — so this is the same defect, not a theoretical one.
Arguably worse than the type-check instance: a package's type-check reaches out only where a tsconfig says so, whereas every package's test run goes through the root Vitest config by construction.
Suggested shape
Symmetric with what #4176 landed, plus the guard question:
Add the root files to the test task's inputs ($TURBO_ROOT$/vitest.config.mts, $TURBO_ROOT$/vitest.setup.*).
cloud#1133 — the same family one repo over: turbo testinputs covering only the package's own src/test while repo-level assertion tests read from outside it. Worth reading alongside this.
Found while implementing #3514 (PR #4176). Filed unassigned; not fixed there because that card is scoped to the
type-checktask.The gap
#3514 established the mechanism: turbo hashes a task from its
inputs,$TURBO_DEFAULT$covers only files inside the package directory, andglobalDependenciesis unset — so any file a task reads from elsewhere in the repo is invisible to the cache key, and turbo replays the previous verdict instead of re-running. CI persists.turbo/cachethroughactions/cache, so the stale result travels.The
testtask has exactly that shape, and every entry in its list is package-relative:vitest.config.*andvitest.setup.*look like they cover the Vitest configuration, but they resolve inside the package. The files that actually decide how a package's tests run live at the repo root, and every package reaches them:The root
vitest.config.mtsowns theunit/dom/dom-heavyproject split,sharedExclude, thedomTsTestsandheavyDomTestslists, and the alias table. The four rootvitest.setup.*files decide which package graphs are registered before a test renders. None of them is hashed by any package'stesttask.Measured
On
claude/issue-3514-turbo-inputs-guard,@object-ui/core:The cache key does not move. The equivalent measurement on
type-checkbefore #4176 produced aFULL TURBOreplay in 44ms over a realTS2688, with--forceon the same tree exiting 2 — so this is the same defect, not a theoretical one.Arguably worse than the
type-checkinstance: a package'stype-checkreaches out only where a tsconfig says so, whereas every package's test run goes through the root Vitest config by construction.Suggested shape
Symmetric with what #4176 landed, plus the guard question:
testtask'sinputs($TURBO_ROOT$/vitest.config.mts,$TURBO_ROOT$/vitest.setup.*).scripts/__tests__/turbo-type-check-inputs.test.ts(from ci(turbo): derive the type-check inputs guard from each package's tsc program (#3514) #4176) is already written against a singleTASKconstant and derives out-of-package files from tsconfig programs. Thetesttask's equivalent derivation is different in kind — it would have to follow thevitest.config.tsre-export chain rather than tsconfiginclude— so whether that is worth deriving or is better served by pinned pairs is a separate judgement, not a copy of guard: turbotype-check的手维护 inputs 名单已两次因"包程序越出包目录"失真 —— 评估从 tsconfig include 派生或加钉扎测试 #3514's answer.Whether the fix is the one-liner alone or the one-liner plus a guard is a maintainer/PM call, the same way #3514's was.
Related
type-check的手维护 inputs 名单已两次因"包程序越出包目录"失真 —— 评估从 tsconfig include 派生或加钉扎测试 #3514 / PR ci(turbo): derive the type-check inputs guard from each package's tsc program (#3514) #4176 — the same mechanism on thetype-checktask, with the full measurement.testinputscovering only the package's ownsrc/testwhile repo-level assertion tests read from outside it. Worth reading alongside this.vitest.config.mts; touches the same file but is a different mechanism.Generated by Claude Code