Repository navigation
test(cli): budget the six remaining cli test files from 13 s up; spawn the source entry with node in three - #28616
Merged
Conversation
… source entry with node in three The remaining packages/cli files from 13 s up in slice 23's table. Each floor is distinct real work (one spawn per distinct command/fixture pair, or a cold @objectstack/runtime import), so each takes a line-2 test-budget header from its slowest CI reading x 1.25. Three files that spawned bin/run-dev.js through the tsx wrapper now spawn it with process.execPath, as metadata-type-schema-gate already does: same entry, same src, same assertions. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FEkQ5pfFsY9QCnzGXyBnPP
Contributor
📓 Docs Drift CheckNothing in this diff resolved to a documentable surface (no symbol, route or SDK anchor derived from 0 changed package(s)), so this run has no opinion about the docs. What this run could not see
Coarse fallback — 0 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): |
Contributor
Author
|
domain:server#1 · os-project-manager · session_01R1q2xdtYgU6FKrZ7LgjPCC 席位核对 · ACCEPT ·
|
| item | reading |
|---|---|
| Shape | Draft, base main, Part of #23181. Exactly slice 28's six packages/cli files, labels tests + skip-changeset. Clause-②: no, Metadata-protocol: none. |
| Diff check (seat) | Line-2 // test-budget: headers on all six (the schema gate 30, the others 20). validate-lint-mapping-connector-source, info-detail-package-fold and emit-json-pipe spawn the source entry on process.execPath instead of the tsx wrapper, argv, cwd and env unchanged; emit-json-pipe keeps tsx for the harnesses that need it, and the now-unused TSX constants are dropped. Prose updated to match. No assertion changes, no shared helper touched, no timeout raised. |
| Evidence | CI green on head 2af0e899 (35 success, 18 skipped, 0 failed). Mergeable state clean. Governed check: NOT governed, 28 changed lines. The report gives 52 of 52 derived gates exit 0 (--ran 0 NOT-MEASURED), cli unit tier 362/362 files, typecheck and scoped eslint exit 0, and A/B of −26.1 % (validate-lint), −26.4 % (info-detail), −4.0 % (emit-json-pipe). |
| Landing | 「按照 pm-dispatch 规则复核过的都授权」 (Leehom, 2026-10-25T11:35Z): ready and auto-merge through the relay, once every check on this head is green or an expected skip. |
Generated by Claude Code
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.
Requested by Leehom · project thread
Part of #23181 (slice 28). The card stays open for later slices: this one takes only the six remaining
packages/clifiles at 13 s and over in slice 23's table.Clause-②: no
Metadata-protocol: none
维护者速读
packages/cli里 CI 读数 13 s 以上、还没有预算头的 6 个测试文件,每个在第 2 行加一行// test-budget:头(metadata-type-schema-gate 30 s,其余 5 个 20 s)。其中 3 个文件原来经node_modules/.bin/tsx包装层起 CLI 源码入口,现在改成直接用process.execPath起同一个bin/run-dev.js,与 metadata-type-schema-gate 已有写法一致。@objectstack/runtime(本地约 9.9 s)。所以都走预算头,能省的只有 tsx 包装层。files[]只有 dist、README、CHANGELOG);没有删、没有放宽任何断言,用例名和数量不变;回滚即 revert。packages/cli/test/validate-lint-mapping-connector-source.test.ts与packages/cli/test/info-detail-package-fold.test.ts(tsx →process.execPath);packages/cli/test/emit-json-pipe.test.ts(只改了末尾那一次 CLI spawn,四个 harness 和对照仍走 tsx)。pnpm --filter @objectstack/cli exec vitest run test/validate-lint-mapping-connector-source.test.ts test/info-detail-package-fold.test.ts→ 10/10 通过。What changes
The six files and their slowest reading over the five scheduled
ci.ymlruns41199450735,41217827347,41237094739,41255489006,41271604267(slice 23's offender table, default reporter's per-file module line in the Test Core shard logs):test/metadata-type-schema-gate.test.tsprocess.execPathos validateon the control, planted-key andlgstacks,os buildon the planted key (its no-artifact claim). About 2.6 s each locally; the in-process cases take under 0.2 s togethersrc/utils/schema-migration-plugins.test.ts@objectstack/runtimefor the AppPlugin it composes, asos servedoes. A probe timed it at 9.86 s under this package's vitest config, plus 3.94 s for the module under test, 1.21 s for plugin-auth (aliased to its src) and 0.45 s for service-automation. Each lands on whichever case triggers it first (the "host config LOADS" case reads 9.9 s); no case repeats ittest/validate-lint-mapping-connector-source.test.tstsxwrapperos validate --jsonandos lint --jsonon the card stack,os lint --jsonon the control stack. The wrapper adds about 1.3 s per spawnprocess.execPath; header 20test/scaffold-test-script-passes.test.tstestruns (init plugin, its empty-suite control, create plugin fresh, afterbuild, its empty-suite control) and three tsc runs (build,typecheckclean,typecheckwith the planted error). Each runs on its own fixture statetest/info-detail-package-fold.test.tstsxwrapper, already in onebeforeAllos info --jsonandos infoon the option-B, top-level and two-package projectsprocess.execPath; header 20test/emit-json-pipe.test.tsconsole.logcontrol, 1 source-CLIos validate --jsonthrough the wrapperemitJsonand ends a different way; the in-processisExitSignalcase pays the cold import offormat.tsand the spec barrel (about 2.3 s)process.execPath; header 20Why the floor is distinct real work. No file repeats a (command, flags, fixture) triple, and the two that spawn the most already share their setup (
info-detailin onebeforeAll;scaffoldmaterialises each fixture once per case, from in-process renderers). Nothing reads a file through a child that could become an in-process read. So every file takes the ruling 6181973363 letter B header: N = the slowest CI reading × 1.25, rounded up to 10 s (16.1 → 30; 15.9, 15.7, 14.9, 14.8, 13.5 → 20). Classspawns the real producer once per single-cause fixturefor the five spawning files,whole-package importforschema-migration-plugins(the precedent is the lint headers that name a cold barrel import as that class). All six parse withreadTestBudget(scripts/measure-test-shard-timings.mjs): line 2, the class and seconds above.The one lever inside the floor. Three files spawned
bin/run-dev.jsthroughnode_modules/.bin/tsx.metadata-type-schema-gate,authoring-rule-command-parityandformat-zod-unionalready run the same entry withprocess.execPath: same entry file, samesrc/, samechildEnv(), same arguments. The three now do the same.emit-json-pipe's four harnesses and its control keeptsx: they importsrc/utils/format.tsdirectly and need its loader, and the pipe they pin is the one the tsx child writes to.Not changed: no assertion, case name, case count, timeout, tier, project or helper. No source file.
Tests
A/B for the three files whose code changed. Base copied beside head as
zzbase.*(git show c6583207:…), one box, one lock hold, N=3. Each side ran in its own vitest invocation (the three files together,--maxWorkers=1) so neither side inherits the other's transform cache, and the order alternated (head first, base first, head first). Reading: the default reporter's per-file line. Copies deleted before the gate run.validate-lint-mapping-connector-sourceinfo-detail-package-foldemit-json-pipeEvery run exit 0, 17/17 tests per side, same names.
emit-json-pipemoved one spawn of six, and it runs first in its invocation, so it pays the cold transform of the spec graph; its header carries it.All six on head, one run with
test/vitest-tiers-partition.test.ts: 7 files, 108/108 passed. Case counts are the same as the base run (8, 52, 3, 9, 7, 7), and the tier partition pin is green, so the three edited files stay inintegration.Header-only files (
metadata-type-schema-gate,schema-migration-plugins,scaffold-test-script-passes): no A/B, per the order.pnpm --filter @objectstack/cli typecheck(tsc andcheck:test-typecheck) exit 0, withNODE_OPTIONS=--max-old-space-size=4096.No ablation: no tested behaviour changed (test-only).
Acceptance notes
schema-migration-plugins' 9.9 s is a config cost, not a test cost.@objectstack/runtimeresolves to itsdist/, but this package'svitest.config.tsaliases several packages that the runtime graph reaches to theirsrc/, so vite transforms them on the first import. The lever is that shared config, which every cli file reads. It is outside this slice's file surface; noted, not filed. Carrier: none.skip-changeset. Test-only.@objectstack/cli'sfiles[]isdist,README.md,CHANGELOG.md; its build emits no*.test.tsintodist/. Nofiles[]content changes.Verification
All readings on head
2af0e899: the fix commitea81aa2fplus one merge oforigin/mainafter slice 23 (#28581) landed, as the order asks. The A/B and the six-file run above were taken onea81aa2f; the merge touches none of the six files.node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack→ 52 families, each run with its exit code captured before any pipe, after a fullpnpm exec turbo run build --concurrency=2(118 tasks, exit 0). All 52 exit 0.--ranreconciliation:✓ dispatch-gates --ran: 52 derived famil(ies) accounted for — 52 run, 0 NOT-MEASURED. On the pre-merge head, before the full build,check:dual-build-cjs-loadsandcheck:i18n-coverageread exit 3 (no full build, a container prerequisite) and the other 50 exit 0.pnpm --filter @objectstack/cli exec vitest run --project unit): 362/362 files, 5155/5155 tests.pnpm exec eslint --no-inline-configover the six files exit 0 (@objectstack/clihas nolintscript; the repo-widepnpm lintis CI's);node scripts/check-commit-card-trailers.mjs --range origin/main..HEADexit 0;node scripts/check-nul-bytes.mjsexit 0.🤖 Generated with Claude Code
https://claude.ai/code/session_01FEkQ5pfFsY9QCnzGXyBnPP