Repository navigation
test(spec): split build-schemas-check-mode.test.ts into six files so the repo project runs them in parallel - #25428
Conversation
…the repo project runs them in parallel The one 5135-line file was the slowest file of the Test Core run (841.97 s, 92 tests) and vitest runs a file's tests serially, so spec's test:repo floor was this file alone. The shared sandbox, git discipline, run() spawner and cross-file constants move to build-schemas-check-mode.fixture.ts (not a test file); each split file registers its own shared sandbox via useSharedSandbox(). The 15 describe blocks move verbatim, grouped by subject and balanced on a measured local run; vitest.repo-tests.json lists the six files, and each carries its own test-budget line. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01P8iUGfP2wffkVBD5uSfDgq
…ode files Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01P8iUGfP2wffkVBD5uSfDgq
check:cross-package-test-inputs reads a test file's own source, not the fixture module it imports, so five of the six split files stopped showing the out-of-package input they run against. Each file now names the repo-root scripts/ directory and hands it to useSharedSandbox(), which is what the fixture symlinks into every sandbox. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01P8iUGfP2wffkVBD5uSfDgq
📓 Docs Drift Check
What this run could not see
Coarse fallback — 144 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): |
|
CI · The job (run Generated by Claude Code |
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01P8iUGfP2wffkVBD5uSfDgq
…irst CI reading The apportioned figures (190-240 s) assumed each file keeps its serial share of the pre-split wall. CI run 39963105499 read the files at 104-458 s: running side by side on a shared runner, the three heaviest each take longer than their serial share. Each budget is now that reading x 1.25, rounded up. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01P8iUGfP2wffkVBD5uSfDgq
维护者速读
席位核对 · ACCEPT(待人批) ·
|
Requested by Tesla · project thread
Fixes #25372
Clause-②: no
Metadata-protocol: none
The card's re-scope (option A, triage comment
6358468116): splitpackages/spec/scripts/build-schemas-check-mode.test.tsinto several files so therepovitest project runs them in parallel. Test-only; noturbo.json, partition,ci.ymlor shard-count change.What changes
One 5135-line file becomes six test files and one shared module. vitest runs a file's tests one at a time, so this file (841.97 s, 92 tests, the slowest file of PR run 39893808670) was spec's
test:repofloor on its own. Therepoproject's pool is vitest's default (cores - 1, so 3 workers on a 4-vCPU runner;VITEST_MAX_WORKERSfromscripts/vitest-worker-cap.mjsonly ever lowers it), so separate files run on separate workers.build-schemas-check-mode.fixture.ts(not a.test.ts, so neither project collects it) carries the family header, the sandbox builders, the [finding] build-schemas-check-mode.test.ts loses its own fixture commit under the merge-queue full-suite run — 10 tests fail on one phantom sha (first occurrence) #9068 git discipline,run(), and every constant more than one block reads. The old rootbeforeAll/afterAllbecomeuseSharedSandbox(rootScriptsDir), which each test file calls once, so every file builds its own shared sandbox (anfs.mkdtemp, so two files never share one). Module state stays per file because vitest isolates each test file's module graph.The 15
describeblocks move verbatim, grouped by subject and balanced on a measured local run of the original file (seconds are that run's per-block sums):.manifest.test.tscheck:authorable-surface在 --check 模式下仍会写json-schema.manifest.json—— 一个「检查」在改工作区 #4711, [finding] Five filter operators ($gt/$gte/$lt/$lte/$between) reach NO published reference page —build-schemas.tsskips their whole schema over an unrepresentablez.date(), and the skip is silent #16431,gen:schemarmSync 整个json-schema/会顺手抹掉gen:openapi的产物,rest 的 openapi 路由测试随后 503 假红——check:generated原地跑 build-schemas 也触发 #5371, [finding] the published bundlejson-schema/objectstack.jsondeclaresx-schema-count: 1596but carries 1585 definitions — and a docs page publishes that field as "the total number of definitions" #12588.deleted-baseline.test.ts.anchor.test.tscheck:authorable-surface在--check模式下也会重写authorable-surface.base.json—— 一次纯核验会改工作区,且任何无关 PR 都能因此静默推进删除门的锚点 #5358.git-topology.test.tsgen:schema在 merge 未 commit 时运行,会把 authorable-surface 锚点倒退回旧 merge-base —— 生成器写入、门全绿、静默撤销 main 的锚点推进 #5370, gen:schema 在锚点「领先于」解析基线时打印「trails the baseline … by 0 key(s)」——方向说反,信息为零 #5847,resolveSurfaceBase()的 tip fallback 是静默的正确性降级 —— 拿不到 merge base 时它照样把「删除」判成违规并exit 1#6452 (the three own-sandbox blocks).retired-keys.test.ts.type就能让一个 tombstone 冒充「已登记迁移」 #4659, [finding] a nested RETIRED_KEYS_BY_MAJOR row is unverifiable — check (b2) passes a fabricated one, so a typo'd nested retirement registers silently and forever #17969.deletion-proofs.test.tsdelivers()message-includes 腿今天只由一个零守着 —— 而通往夹具的三条路各被本仓自己写着的一条规矩堵住 #18865Block-local constants travel with their block; constants two files read live in the fixture.
Each test file names its out-of-package input.
check:cross-package-test-inputsreads a test file's own source, not the modules it imports, so five of the six files at first stopped showing that they run against the repo-rootscripts/and the gate asked to move them tolocal. Each file now resolves../../../scriptsitself and hands it touseSharedSandbox(), which is the path the fixture symlinks into every sandbox. They stay in therepoproject.vitest.repo-tests.jsonlists the six files in place of the one.Budget lines. Each file carries its own
// test-budget:line. No CI reading of a split file exists yet, so each figure is apportioned: the pre-split file's slowest CI reading (983.3 s, run 38798542648, the reading the old 1230 line rested on) times the file's share of the local run, times 1.25, rounded up to 10 s (190 to 240 s). Each line says so and asks to be re-measured once CI has read the file on its own.Prose references to the old file name in
packages/spec/scripts/**(build-schemas.tsand eight sibling tests) point at the split file or the fixture they mean.No changeset:
scripts/ships in no package'sfiles[](spec'sfilesisdist,json-schema,liveness,prompts,llms.txt,README.md,src/**/*.zod.ts,CHANGELOG.md).Verification (head
78a4221bd)vitest list --project repoon the old file and on the six new files, file prefix stripped, sorted: 92 and 92 names,diffempty.vitest list --project localmatches none of the files.repoproject: 370.44 s wall, 92/92 passed, slowest filegit-topology205.4 s. The before figure from CI is on the card: 841.97 s for the file, spec two-task total 1212.41 s (PR run 39893808670) and 1494.69 s in merge-group run 39894014103. The after figure from CI is this PR's ownTest Coretiming table, read by the seat at review.pnpm --filter @objectstack/spec build,typecheck(includescheck:scripts-typecheck): exit 0.pnpm --filter @objectstack/spec test: 711/711 files, 21634 passed, 1 todo.node scripts/pm/dispatch-gates.mjs --commandsderived 66 families on the final head78a4221bd; all 66 ran and exit 0.--ranreconciliation: 66 run, 0 NOT-MEASURED, 0 UNRUN. On the first sweep (head9f2ed009f, 63 families)check:cross-package-test-inputsanswered 1 (fixed above),check-plugin-teardown-shape --self-testanswered 3 (its pinned control commit was missing from the shallow clone; fetched), andcheck:dual-build-cjs-loads/check:lean-entry-closureanswered 3 (no built dist); all exit 0 on the final sweep.Acceptance notes
Test Coretiming table drops") can only be read after this lands in a merge group; the before figure above is the one to compare against.scripts/git-env.d.mts:9(repo root, outside this card's file surface) still names the old file in prose, andscripts/report-test-timings.mjs:935/943uses the old name as a fixture log line (correct as data). Noted, not changed.CI after-numbers (run 39963105499, head
dce4c6406,pull_request, Test Core aggregate job 120460015448)git-topology), 420.84 s (deleted-baseline), 386.75 s (deletion-proofs), 147.50 s (retired-keys), 140.73 s (manifest) and 104.13 s (anchor). The slowest is now 457.69 s.ab63b4e7e: each is the CI reading × 1.25, rounded up (580, 530, 490, 190, 180 and 140 s). They replace the first apportioned estimates (190 to 240 s), which assumed each file keeps its serial share and came in under the three heaviest readings.🤖 Generated with Claude Code
https://claude.ai/code/session_01P8iUGfP2wffkVBD5uSfDgq