Repository navigation
test(ui): read the Test UI shard width from ci.yml instead of spelling /16 - #26516
Merged
Merged
Conversation
…g /16 The two selector self-tests pinned the `test-ui` matrix width as a literal `/16`. They now ask `scripts/ci-shard-matrix.mjs` `shardTotal(ci.yml, 'test-ui')`, so the width lives in the workflow only and a resize moves every `/N` they expect with it. Claude-Session: https://claude.ai/code/session_01ADHkmRRgsu9coZffDuXRpz Co-authored-by: Claude <noreply@anthropic.com>
Contributor
Author
席位核对 · ACCEPT · seat
|
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 Steve · project thread
Part of #26443
Clause-②: no
Metadata-protocol: none
维护者速读
/16,改为调用scripts/ci-shard-matrix.mjs的shardTotal(ci.yml, 'test-ui')读出 Test UI 的分片数。16。ui/scripts/__tests__/select-affected-tests.test.ts(宽度断言那一段)、ui/scripts/__tests__/select-affected-tests-wiring.test.ts(RUN_HEADER 与三处--shard=1/N)。cd ui && pnpm exec vitest run scripts/__tests__/select-affected-tests-wiring.test.ts scripts/__tests__/select-affected-tests.test.ts,预期 2 个文件 49 个用例全绿。What changes
Test-only, two files under
ui/scripts/__tests__/(both edits are the card's deliverable, no other test was forced to move):select-affected-tests-wiring.test.ts:RUN_HEADERand the three--shard=1/16/shard 1 of 16expectations now useSHARDS = shardTotal(ci.yml text, UI_JOBS.test). The workflow text is read once, before the header is built.select-affected-tests.test.ts("keeps the matrix width and the full-suite command for the full battery"): the literalshard: [1, ..., 16]list and the three/16spellings are replaced byshardTotal(rootCi(), UI_JOBS.test); the run-step header is now asserted present (the oldjob.indexOf(...)slice silently fell back to the job's last character when the header was missing).Both import the reader as
../../../scripts/ci-shard-matrix.mjsand read ci.yml through the files' existing root resolution (workspaceRoot()/rootCi())..github/workflows/ci.ymlandscripts/ci-shard-matrix.mjsare untouched.Tests
At head 9507724:
pnpm exec vitest runon the two files:Test Files 2 passed (2),Tests 49 passed (49)(os-verify-lock VERDICT command-exit 0).Ablation (on-disk ci.yml mutation through
scripts/ablation-replace.mjs, restored by trap; blob back to HEAD b1014f87af2c andgit diff HEADempty after each leg):Leg A: test-ui matrix list alone resized to 12, /16 left in the name and run step
New tests:
Tests 1 failed | 38 passed, both files red. The wiring file refuses at load:ci.yml has no step headed "- name: Run the ui tests (shard ${{ matrix.shard }}/12)"; the selector file fails "keeps the matrix width...". So the tests still require the run step to agree with the matrix.Leg B: the whole test-ui job resized to 12 (list, all four /16, "of 16.")
node scripts/ci-shard-matrix.mjs --job test-uianswers 12. New tests:Test Files 2 passed,Tests 49 passed: they follow the workflow. The origin/main versions of the same two files against the same mutated ci.yml:Tests 1 failed | 38 passed, both files red: they stayed pinned at 16.Acceptance notes
select-affected-testsselector reaches a rootscripts/change only through its always-on set; these two files live inui/scripts/__tests__/, which that set covers, so a later change toscripts/ci-shard-matrix.mjsstill re-runs them.git grep -nE "/(3|8|16)\b") has zero hits. Over all ofui/scripts/__tests__/*.tsthe remaining shard-shaped hits are prose (Test (shard N/16)in the headers of check-eager-closure-budget, check-skill-examples and check-test-path-roots, which name objectui's retired job) and check-test-shard-results' own synthetic 8-shard roster, which reads no workflow. None copies a live ci.yml size, and all are outside this card's file surface.Verification
node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstackat 9507724 derived 18 commands; all 18 run locally, exit codes recorded before any pipe.--ran: "18 derived, 18 run, 0 NOT-MEASURED, 0 UNRUN".Per-command exit codes
17 of 18 exit 0: check-closing-keyword-parity (scan and --self-test), check-comment-mask-corpus, check:cross-package-test-inputs, check:driver-memory-census, check:engine-double-contract, check:gitlink-declared, check:nul-bytes, check:published-files, check:query-options-erasure, check:refd-timer-probe, check:tier-file-adoption, check:type-check-coverage, check:type-check-debt, check:undeclared-dep-imports, check:watch-hint-literal, check:where-matcher.
pnpm --dir ui exec vitest run scripts/exit 1, not caused by this diff:Cannot find package '@objectstack/spec/...'(the container had not built the seven ui deps that CI's Test UI builds first);turbo run buildof those seven closures (VERDICT command-exit 0):Test Files 1 failed | 177 passed | 2 skipped,Tests 1 failed | 5096 passed. The one red is a 15 s timeout incheck-i18n-dead-keys.test.ts("keeps every key it makes reachable OUT of both tiers") on the shared box; that file alone:Tests 134 passed (134), VERDICT command-exit 0. Both changed files are green in that run.CI check-runs: in progress at the time of writing; Test UI is the authority for the suite.
Generated by Claude Code