Repository navigation
ci: test lanes call root test scripts instead of raw commands - #8389
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
PR Analysis Report
|
There was a problem hiding this comment.
Changes requested: the lane commands move into root scripts with the same commands, jobs and required checks, but the new script expansion disables one existing guard in .github/scripts/ci-test-routing.test.mjs. runLines now expands pnpm test to vitest run, so "gives no lane the whole suite" (lines 213–222), which still looks for pnpm test, can no longer fail: adding a bare - run: pnpm test step to test-node fails that test on main but passes on this branch. Running that guard on the unexpanded step.run lines restores it. Please also consider listing pnpm test:ui:isolated next to pnpm test:ui in CONTRIBUTING.md, since test:ui leaves out the FR23 benchmark that CI runs on its own.
[Automated review]
| return (job?.steps ?? []) | ||
| .map(step => step.run) | ||
| .filter(Boolean) | ||
| .map(expandScripts) |
There was a problem hiding this comment.
Expanding here turns a bare pnpm test into the root test script, vitest run, so the "gives no lane the whole suite" guard at lines 213–222, which still matches /^\s*pnpm test\s*$/m, can no longer fail. Adding - run: pnpm test to test-node fails that test on main and passes on this branch. Running the guard on the unexpanded lines restores it:
const raw = (workflow.jobs[lane]?.steps ?? [])
.map(step => step.run ?? '')
.join('\n');
expect(raw, `${lane} runs the whole suite`).not.toMatch(/^\s*pnpm test\s*$/m);| pnpm -F @astryxdesign/core test | ||
|
|
||
| # One Vitest project, as CI runs it (CI shards each across legs) | ||
| pnpm test:ui |
There was a problem hiding this comment.
pnpm test:ui leaves out Markdown.fr23.perf.test.ts, which CI runs on its own through pnpm test:ui:isolated (test-ui leg 1 and deploy.yml), so this isn't quite the UI project "as CI runs it". Listing pnpm test:ui:isolated here would close the gap.
There was a problem hiding this comment.
No changes needed: each lane now calls a root script whose body is exactly the command its step ran, and job names, step conditions and required checks are unchanged, as spec:AST-030 FR7 and FR11 require. Both earlier points are addressed: the whole-suite guard in .github/scripts/ci-test-routing.test.mjs reads the steps as written again, and CONTRIBUTING.md lists pnpm test:ui:isolated. One trade-off to keep in mind: a failing Build or theme-family stage now appears as a single step (Run Build package contracts, Run the theme-family contract), so its log names the failing command.
[Automated review]
Maintainer impact
The Vitest lanes in
ci.ymlanddeploy.yml, the Build package's contracts, and the theme-family contract are spelled out as raw commands in workflow steps. A contributor who adds a Build contract or changes how a suite runs edits workflow YAML (and its copy indeploy.yml), and local runs cannot reproduce exactly what CI ran.Intended invariant
spec:AST-030(current): one test lane per surface; new coverage joins that lane's owner without a new lane or required context (FR11); required names stay (FR7); Build's test owner includes its CSS-layer cascade, theme-family staystheme-buildcoverage in the Node lane (FR11). Nothing about which tests run, where, or in which order changes.Change
Root scripts, named by purpose in the repo's colon style, with exactly the commands the steps ran:
test:ui/test:ui:isolated: theuiproject without FR23, then FR23 alone with no file parallelism.test-uishards callpnpm test:ui --shard=…; leg 1 anddeploy.ymlcallpnpm test:ui:isolatedafter it.test:node: thenodeproject (test-nodeshards,deploy.yml).test:build: packed-consumer contract, Vite plugin build, CSS-layer cascade guard, cross-package StyleX marker browser check (test-build).test:theme-family: core build, maintained fixture, cascade guard (test-nodeleg 1).The workflow contract tests now expand
pnpm <script>to its body before checking commands, so every routing invariant (each project in exactly one lane, FR23 isolation, build-before-guard ordering) is still enforced against what runs.Job names, steps' conditions, and required contexts are unchanged. Split out of #8367 at CodeBunny's request.
Evidence
ci.yml(anddeploy.ymlfor the Vitest projects).main(test-ui594+1 files,test-node777 files;test-build3 files).Scope
Testing
vitest run --project node .github/scripts/ci-test-routing.test.mjs .github/scripts/ci-tooling-routing.test.mjs .github/scripts/prebuilt-data-routing.test.mjs .github/scripts/visual-gate/workflow-concurrency.test.mjs scripts/stylex-module-resolution.test.mjs .github/scripts/release-check-workflow.test.mjs: 140 passed.