Skip to content

ci: test lanes call root test scripts instead of raw commands - #8389

Merged
cixzhang merged 2 commits into
mainfrom
ci/test-scripts
Oct 25, 2026
Merged

cixzhang merged 2 commits into
mainfrom
ci/test-scripts

Conversation

@cixzhang

Copy link
Copy Markdown
Contributor

Maintainer impact

The Vitest lanes in ci.yml and deploy.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 in deploy.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 stays theme-build coverage 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: the ui project without FR23, then FR23 alone with no file parallelism. test-ui shards call pnpm test:ui --shard=…; leg 1 and deploy.yml call pnpm test:ui:isolated after it.
  • test:node: the node project (test-node shards, 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-node leg 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

  • Failure before the change: adding a Build contract or changing a suite's flags required editing the step in ci.yml (and deploy.yml for the Vitest projects).
  • Success after the change: the same commands run through the scripts; ci: discover PR browser accessibility specs, so a new spec needs no workflow edit #8367's first head ran these exact scripts in CI with the same file and test counts as main (test-ui 594+1 files, test-node 777 files; test-build 3 files).
  • Product/runtime behavior verified unchanged: CI-only.

Scope

  • No intended public API, product behavior, visual direction, or policy change.
  • Product changes discovered during the work were removed or split.
  • Public text and artifacts contain no internal Meta context.

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.

@vercel

vercel Bot commented Oct 25, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
astryx Ready Ready Preview Oct 25, 2026 10:07am UTC

Request Review

@astracat-bot

astracat-bot Bot commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
🟢 Reviewed (for maintainers only) Oct 25, 2026, 10:33 AM UTC

@github-actions

github-actions Bot commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

PR Analysis Report

Previews ready: Storybook and Sandbox were built with this PR's docsite. CI evidence will be added when available.

View Storybook for this PR · View Sandbox for this PR

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Oct 25, 2026

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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);

Comment thread CONTRIBUTING.md Outdated
pnpm -F @astryxdesign/core test

# One Vitest project, as CI runs it (CI shards each across legs)
pnpm test:ui

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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]

@cixzhang
cixzhang merged commit a19e396 into main Oct 25, 2026
70 checks passed
@github-actions
github-actions Bot deleted the ci/test-scripts branch October 26, 2026 06:31

This branch was successfully deployed

1 active deployment
Preview — 748db9eb Deployed Oct 25, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant