Repository navigation
test(plugin-gantt): fold seven ObjectGantt fetch and row pins onto one shared harness - #30725
Merged
Merged
Conversation
…e shared harness The seven ObjectGantt pins that render the real component over the same three mocks (sonner's toast, a GanttView stand-in, and plugin-detail's drawer stubbed out) now live in ObjectGantt.harness.test.tsx, one top-level describe per former file. Each block installs its own GanttView stand-in in a beforeEach through a vi.hoisted slot the shared mock reads. Fixtures, hooks and assertions move verbatim: 35 it titles and 106 expect( calls before and after. Part of the shared-setup rollout to the four component families. Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L6bhgXNVxCQk1CCy55gFjQ
… the shared harness Comments inside the harness that named a sibling pin's former file now name its block in this file, and the two plugin-gantt test files that pointed at a folded file now name the harness and the block. Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L6bhgXNVxCQk1CCy55gFjQ
Contributor
Author
|
domain:ui#1 · os-sales · session_01L6bhgWn6zhNa4LL7VB1rtL 维护者速读
席位核对 — ACCEPT · head f18fd96
|
This was referenced Nov 6, 2026
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 Sales · project thread
Part of #29469
Clause-②: no
Metadata-protocol: none
维护者速读
ObjectGantt.harness.test.tsx,每个原文件变成文件里一个顶层describe;断言一字未改。ObjectGantt.harness.test.tsx开头 70 行(共享 mock 与standIns槽位);再看任一块的beforeEach。ui/下跑pnpm exec vitest run packages/plugin-gantt/src/ObjectGantt.harness.test.tsx,应见 1 个文件、35 个测试全过。What changes
Slice 1 of the
ObjectGantt*family in the shared-setup rollout that ruling 6583487846 on #29469 orders, in the shape of the #25911 pilot (PR #26309). SevenObjectGanttpins render the realObjectGanttover the same three mocks:sonner's toast, a./GanttViewstand-in, and@object-ui/plugin-detailwithRecordDetailDrawerandderiveRecordPageHrefstubbed out. Only theGanttViewstand-in differed between them, in which task attributes it writes to the DOM. They now live in one new file,ui/packages/plugin-gantt/src/ObjectGantt.harness.test.tsx:describenamed after it (ObjectGantt.fetchGate-7225and so on), with its docblock above it../GanttViewmock reads avi.hoistedslot (standIns.ganttView), and each block installs its own stand-in, verbatim, in abeforeEach.vi.mockcalls and the wrapper lines.sonnerandplugin-detailmocks were byte-identical in all seven files and are declared once../indexis imported once (one block renders throughSchemaRenderer), soobject-ganttis registered for the whole file. No block asserts that key absent.The test-only diff: no
srcfile, no changeset (skip-changeset:@object-ui/plugin-ganttshipsdist,README.md,CHANGELOG.mdandLICENSEonly). Besides the move, comments that named a folded file now name its block: five inside the harness, one inObjectGantt.expandFls-7230.test.tsxand one in__tests__/recordSourceInputs-10394.test.tsx.Why
Every
dom-project test file pays a fixed cost (environment, setup and the module graph) before its first test runs, and for these seven that fixed cost was about 95 % of their CPU (19.9 of 20.9 s, run 1). One harness file pays it once. #29469 rolls the #25911 pilot out component by component; this is the firstObjectGanttslice.Tests
Former file → describe (no title or assertion dropped)
Mechanical count: a TypeScript AST walk of each former file at
4bf9a2d7e(it/testtitles andexpect(calls) against thedescribeof the same name in the harness at this PR's head.itbeforeitafterexpect(beforeexpect(afterObjectGantt.fetchGate-7225.test.tsxObjectGantt.rowCeiling-7210.test.tsxObjectGantt.hostDataProp-7210.test.tsxObjectGantt.emptyHostData-7333.test.tsxObjectGantt.inlineQueryKeys-8769.test.tsxObjectGantt.searchTerm-10250.test.tsxObjectGantt.ruleArrayFilter-10767.test.tsxThe run agrees: the seven files reported 35 passed tests, and the harness reports the same 35.
CPU before and after (local A/B, one machine)
CI after: NOT MEASURED. The per-file timings reporter (#29517) uploads its reports on
main's full-batterypushandscheduleruns only, never on a pull request, andui/scripts/test-shard-timings.jsonwas last regenerated on 2026-10-19. The first CI after-reading is the first full-battery run onmainafter this merges. The CI before-reading from that dataset is 35.6 s of module time for the seven files.Local A/B on one 4-vCPU container, same command both legs, run twice each, from
ui/:pnpm exec vitest run <every ObjectGantt*.test.ts(x) in plugin-gantt> --maxWorkers=2, with a throwaway reporter reading each module'sdiagnostic(). Fixed = environment + prepare + setup + import. The "before" leg is4bf9a2d7e's seven files restored into this branch's tree and the harness removed, so both legs run the same 49 other files. Shared-box seconds.The seven pins went from 20.8 s to 8.3 s of CPU (−60 %), and the family from 175.7 s to 156.8 s (−10.8 %), wall −10 %. Each folded file saved about 2.1 s of fixed cost on this box; the harness's own fixed cost (7.5 s) is that of one cold file. The A/B ran on
10033623; the head adds one comment-only commit (f18fd963).Acceptance notes
ObjectGantt.*pin files carry 29 differentGanttViewstand-ins and seven different mock sets. These seven share one mock set exactly, and folding them moves 2,650 changed lines, under the 3,000-line bar. The other files on the same three mocks (colorFieldLadder-7243,elementDataSource,invalidationRefetch-10035,propertiesBag-10859,retiredApiProvider-12325) are the family's next slice, into this same file, after this one merges.ObjectGantt.tsx,index.tsx,plugin-timeline/src/ObjectTimeline.tsx,plugin-list/src/ListView.tsx,plugin-view/src/ObjectView.tsx) and seven test files in other packages (plugin-list×5,react×1,plugin-view×1) mention a folded file by name in a comment. The claim forbids source edits, and the stems still find the right block:git grep ObjectGantt.hostDataProp-7210lands on itsdescribein the harness. Noted, not filed.react-i18nextNO_I18NEXT_INSTANCEwarning printed once per former file before, and once for the harness now. It was there before this change.Verification
At head
f18fd963:pnpm exec vitest run packages/plugin-gantt/ --maxWorkers=2fromui/: 100 files passed, 1 skipped; 788 tests passed, 114 skipped. The skipped file and tests are skipped onmaintoo.pnpm run type-checkinui/packages/plugin-gantt(tsc --noEmit && tsc -p tsconfig.test.json), afterturbo run build --filter='@object-ui/plugin-gantt^...': exit 0, 0error TS.tsc -p tsconfig.test.json --listFilesOnlylists the harness (101 test files in the program).eslinton the harness: 0 errors, 43 warnings, allno-explicit-any. The seven former files gave the same 43 warnings at4bf9a2d7e.pnpm run lintinui/packages/plugin-gantt: exit 0, 0 errors.node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack): 26 derived, 26 run, each exit 0 (24 quick checks re-run atf18fd963;pnpm check:type-check-debtandpnpm --dir ui exec vitest run scripts/, 170 files passed and 2 skipped, 4970 tests passed).--ranreconciliation: 26 derived, 26 run, 0 NOT-MEASURED.git diff --shortstat 4bf9a2d7e f18fd963is 10 files, +1297 / -1353, 2,650 changed lines, under 3,000. The branch merges cleanly ontomainat6ef7f583(no commit since the base touchesplugin-gantt).Human Minimum
packages/specholds no runtime logic. (packages/specnot touched.)pnpm lintpasses. (ui/is linted by its own config; the package lint is above.)main, one pull request.skip-changeset.)packages/spectouched: its generated artifacts are regenerated and committed. (Not touched.)content/docs/references/,packages/*/CHANGELOG.mdorcontent/docs/releases/.Generated by Claude Code
🤖 Generated with Claude Code
https://claude.ai/code/session_01L6bhgXNVxCQk1CCy55gFjQ