Skip to content

fix(vibe-tests): run pnpm through cmd.exe on Windows in more scripts - #5843

Merged
cixzhang merged 3 commits into
meta:mainfrom
HelloOjasMutreja:fix/vibe-tests-spawnsync-pnpm-windows-part2
Sep 21, 2026
Merged

cixzhang merged 3 commits into
meta:mainfrom
HelloOjasMutreja:fix/vibe-tests-spawnsync-pnpm-windows-part2

Conversation

@HelloOjasMutreja

Copy link
Copy Markdown
Contributor

Follow-up to #5841, which fixed the same pnpm-spawn-on-Windows bug in internal/vibe-tests/src/fixture-suite.mjs. This applies the identical fix to the three other spots that spawn pnpm directly without shell handling:

  • scripts/fixture-browser.mjs (spawnSync, used by fixtures:contrast/fixtures:screenshots)
  • setup-test/run-setup.mjs (execFileSync, used by setup:prepare)
  • setup-test/setup-canonical.test.ts (execFileSync, its own inline run() helper)

Why this matters even though it's not blocking check:repo

setup-canonical.test.ts's pnpm-spawning tests are gated behind ASTRYX_CANONICAL_SETUP_BROWSER=1, which is only set by the fixture-contrast CI job — and that job runs on 2-core-ubuntu-arm, so the bug is silent there. It only bites a Windows contributor who runs setup:prepare, fixtures:contrast/fixtures:screenshots, or the canonical setup test suite locally.

Fix

Same pattern as #5841: shell out through cmd.exe /d /s /c pnpm ... on win32, call pnpm directly elsewhere. Every argument at every call site is a hardcoded literal, never user input, so this avoids Node's DEP0190 shell-argument-escaping deprecation warning that plain shell: true would trigger.

What I deliberately left alone

run-setup.mjs and setup-canonical.test.ts also both shell out to cp -al (GNU hardlink flag) to link a prepared node_modules into each sandbox. That's a separate, pre-existing Windows breakage (no Windows equivalent for the flag, and creating hardlinks this way fails with Permission denied) — confirmed with a real run, out of scope for this PR.

Testing

  • Directly verified both spawn mechanisms (the spawnSync variant used in fixture-browser.mjs, and the execFileSync variant used in the other two) against a real pnpm --version call on Windows — both succeed.
  • Ran setup-canonical.test.ts with ASTRYX_CANONICAL_SETUP_BROWSER=1 for real: it got past both runPnpm calls (pnpm install, pnpm -F @astryxdesign/core build) successfully before hitting the separate, expected cp -al failure described above — real evidence the fix works, not just that it compiles.
  • Confirmed the public-artifact-cli.test.mjs failures seen in the same test run are pre-existing and unrelated: they fail identically against the unfixed baseline (a different bug, .bin/tsx needing the same treatment — filed as its own follow-up).
  • npx eslint internal/vibe-tests/setup-test/setup-canonical.test.ts — clean. The two .mjs files are outside the linted packages/cli scope, matching the project's existing .mjs lint-ignore convention.

@vercel

vercel Bot commented Sep 1, 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 Sep 12, 2026 8:42am UTC

Request Review

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Sep 1, 2026
@github-actions github-actions Bot added community Authored by a community contributor (not on the eng/design team) needs:code-review High-risk change (new package/component/API) — needs human code review before merge labels Sep 1, 2026
@HelloOjasMutreja
HelloOjasMutreja marked this pull request as ready for review September 1, 2026 21:05
github-actions Bot added a commit that referenced this pull request Sep 1, 2026
@github-actions

github-actions Bot commented Sep 1, 2026 •

Copy link
Copy Markdown
Contributor

PR Analysis Report

📚 Storybook Preview

View Storybook for this PR
GitHub Pages may take up to a minute to hydrate after deploy.

🧪 Sandbox Preview

View Sandbox for this PR
GitHub Pages may take up to a minute to hydrate after deploy.

No new or modified components detected.

Bundle Size Summary

No component packages changed.

Accessibility Audit

Status: 36 accessibility violation(s) found — 2 critical, 34 serious.

Button pattern - 1 issue(s)
  • 🟠 serious: Ensure the contrast between foreground and background colors meets WCAG 2 AA minimum contrast ratio thresholds
    • Rule: color-contrast · Affects 1/18 stories · Learn more
    • WCAG: 1.4.3 (Level AA)
ChatComposer - 1 issue(s)
  • 🟠 serious: Ensure the contrast between foreground and background colors meets WCAG 2 AA minimum contrast ratio thresholds
    • Rule: color-contrast · Affects 1/18 stories · Learn more
    • WCAG: 1.4.3 (Level AA)
ChatComposerInput - 1 issue(s)
  • 🟠 serious: Ensure the contrast between foreground and background colors meets WCAG 2 AA minimum contrast ratio thresholds
    • Rule: color-contrast · Affects 1/14 stories · Learn more
    • WCAG: 1.4.3 (Level AA)
ChatReasoning - 1 issue(s)
  • 🟠 serious: Ensure the contrast between foreground and background colors meets WCAG 2 AA minimum contrast ratio thresholds
    • Rule: color-contrast · Affects 4/5 stories · Learn more
    • WCAG: 1.4.3 (Level AA)
ChatToolCalls - 1 issue(s)
  • 🟠 serious: Ensure the contrast between foreground and background colors meets WCAG 2 AA minimum contrast ratio thresholds
    • Rule: color-contrast · Affects 10/11 stories · Learn more
    • WCAG: 1.4.3 (Level AA)
Checkbox pattern - 1 issue(s)
  • 🟠 serious: Ensure the contrast between foreground and background colors meets WCAG 2 AA minimum contrast ratio thresholds
    • Rule: color-contrast · Affects 2/33 stories · Learn more
    • WCAG: 1.4.3 (Level AA)
CheckboxList - 1 issue(s)
  • 🟠 serious: Ensure the contrast between foreground and background colors meets WCAG 2 AA minimum contrast ratio thresholds
    • Rule: color-contrast · Affects 4/17 stories · Learn more
    • WCAG: 1.4.3 (Level AA)
ClickableCard - 1 issue(s)
  • 🟠 serious: Ensure the contrast between foreground and background colors meets WCAG 2 AA minimum contrast ratio thresholds
    • Rule: color-contrast · Affects 1/5 stories · Learn more
    • WCAG: 1.4.3 (Level AA)
CodeEditor - 1 issue(s)
  • 🟠 serious: Ensure the contrast between foreground and background colors meets WCAG 2 AA minimum contrast ratio thresholds
    • Rule: color-contrast · Affects 3/7 stories · Learn more
    • WCAG: 1.4.3 (Level AA)
CodeEditorPerf - 1 issue(s)
  • 🟠 serious: Ensure the contrast between foreground and background colors meets WCAG 2 AA minimum contrast ratio thresholds
    • Rule: color-contrast · Affects 2/2 stories · Learn more
    • WCAG: 1.4.3 (Level AA)
CodeEditorTheme - 1 issue(s)
  • 🟠 serious: Ensure the contrast between foreground and background colors meets WCAG 2 AA minimum contrast ratio thresholds
    • Rule: color-contrast · Affects 13/14 stories · Learn more
    • WCAG: 1.4.3 (Level AA)
CodeTheme - 1 issue(s)
  • 🟠 serious: Ensure the contrast between foreground and background colors meets WCAG 2 AA minimum contrast ratio thresholds
    • Rule: color-contrast · Affects 14/16 stories · Learn more
    • WCAG: 1.4.3 (Level AA)
DateRangeInput - 1 issue(s)
  • 🔴 critical: Ensure an element's role supports its ARIA attributes
    • Rule: aria-allowed-attr · Affects 1/20 stories · Learn more
    • WCAG: 4.1.2 (Level A)
FileInput - 1 issue(s)
  • 🟠 serious: Ensure the contrast between foreground and background colors meets WCAG 2 AA minimum contrast ratio thresholds
    • Rule: color-contrast · Affects 3/15 stories · Learn more
    • WCAG: 1.4.3 (Level AA)
GridMasonry - 1 issue(s)
  • 🟠 serious: Ensure the contrast between foreground and background colors meets WCAG 2 AA minimum contrast ratio thresholds
    • Rule: color-contrast · Affects 1/3 stories · Learn more
    • WCAG: 1.4.3 (Level AA)
Heading - 1 issue(s)
  • 🟠 serious: Ensure the contrast between foreground and background colors meets WCAG 2 AA minimum contrast ratio thresholds
    • Rule: color-contrast · Affects 1/16 stories · Learn more
    • WCAG: 1.4.3 (Level AA)
Icon - 1 issue(s)
  • 🟠 serious: Ensure the contrast between foreground and background colors meets WCAG 2 AA minimum contrast ratio thresholds
    • Rule: color-contrast · Affects 1/18 stories · Learn more
    • WCAG: 1.4.3 (Level AA)
LogStream - 1 issue(s)
  • 🟠 serious: Ensure the contrast between foreground and background colors meets WCAG 2 AA minimum contrast ratio thresholds
    • Rule: color-contrast · Affects 2/3 stories · Learn more
    • WCAG: 1.4.3 (Level AA)
MediaTheme Auto - 1 issue(s)
  • 🟠 serious: Ensure the contrast between foreground and background colors meets WCAG 2 AA minimum contrast ratio thresholds
    • Rule: color-contrast · Affects 1/5 stories · Learn more
    • WCAG: 1.4.3 (Level AA)
PowerSearch - 1 issue(s)
  • 🟠 serious: Ensure the contrast between foreground and background colors meets WCAG 2 AA minimum contrast ratio thresholds
    • Rule: color-contrast · Affects 2/26 stories · Learn more
    • WCAG: 1.4.3 (Level AA)
ProgressBar - 1 issue(s)
  • 🟠 serious: Ensure the contrast between foreground and background colors meets WCAG 2 AA minimum contrast ratio thresholds
    • Rule: color-contrast · Affects 2/18 stories · Learn more
    • WCAG: 1.4.3 (Level AA)
Radio group pattern - 1 issue(s)
  • 🟠 serious: Ensure the contrast between foreground and background colors meets WCAG 2 AA minimum contrast ratio thresholds
    • Rule: color-contrast · Affects 3/26 stories · Learn more
    • WCAG: 1.4.3 (Level AA)
RadioList - 1 issue(s)
  • 🟠 serious: Ensure the contrast between foreground and background colors meets WCAG 2 AA minimum contrast ratio thresholds
    • Rule: color-contrast · Affects 3/13 stories · Learn more
    • WCAG: 1.4.3 (Level AA)
RichTextEditor - 2 issue(s)
  • 🟠 serious: Ensure every ARIA input field has an accessible name
    • Rule: aria-input-field-name · Affects 2/18 stories · Learn more
    • WCAG: 4.1.2 (Level A)
  • 🔴 critical: Ensure every form element has a label
    • Rule: label · Affects 1/18 stories · Learn more
    • WCAG: 4.1.2 (Level A)
SelectableCard - 1 issue(s)
  • 🟠 serious: Ensure the contrast between foreground and background colors meets WCAG 2 AA minimum contrast ratio thresholds
    • Rule: color-contrast · Affects 1/4 stories · Learn more
    • WCAG: 1.4.3 (Level AA)
Stepper - 1 issue(s)
  • 🟠 serious: Ensure the contrast between foreground and background colors meets WCAG 2 AA minimum contrast ratio thresholds
    • Rule: color-contrast · Affects 1/30 stories · Learn more
    • WCAG: 1.4.3 (Level AA)
TableGroupedRows - 1 issue(s)
  • 🟠 serious: Ensure ARIA attributes are used as described in the specification of the element's role
    • Rule: aria-conditional-attr · Affects 3/3 stories · Learn more
    • WCAG: 4.1.2 (Level A)
TableTree - 1 issue(s)
  • 🟠 serious: Ensure ARIA attributes are used as described in the specification of the element's role
    • Rule: aria-conditional-attr · Affects 8/9 stories · Learn more
    • WCAG: 4.1.2 (Level A)
Text - 1 issue(s)
  • 🟠 serious: Ensure the contrast between foreground and background colors meets WCAG 2 AA minimum contrast ratio thresholds
    • Rule: color-contrast · Affects 1/23 stories · Learn more
    • WCAG: 1.4.3 (Level AA)
Theme - 1 issue(s)
  • 🟠 serious: Ensure the contrast between foreground and background colors meets WCAG 2 AA minimum contrast ratio thresholds
    • Rule: color-contrast · Affects 1/5 stories · Learn more
    • WCAG: 1.4.3 (Level AA)
PopArt - 1 issue(s)
  • 🟠 serious: Ensure the contrast between foreground and background colors meets WCAG 2 AA minimum contrast ratio thresholds
    • Rule: color-contrast · Affects 3/6 stories · Learn more
    • WCAG: 1.4.3 (Level AA)
Thumbnail - 1 issue(s)
  • 🟠 serious: Ensure the contrast between foreground and background colors meets WCAG 2 AA minimum contrast ratio thresholds
    • Rule: color-contrast · Affects 1/12 stories · Learn more
    • WCAG: 1.4.3 (Level AA)
Timestamp - 1 issue(s)
  • 🟠 serious: Ensure the contrast between foreground and background colors meets WCAG 2 AA minimum contrast ratio thresholds
    • Rule: color-contrast · Affects 1/20 stories · Learn more
    • WCAG: 1.4.3 (Level AA)
Token - 1 issue(s)
  • 🟠 serious: Ensure the contrast between foreground and background colors meets WCAG 2 AA minimum contrast ratio thresholds
    • Rule: color-contrast · Affects 2/10 stories · Learn more
    • WCAG: 1.4.3 (Level AA)
Tokenizer - 1 issue(s)
  • 🟠 serious: Ensure the contrast between foreground and background colors meets WCAG 2 AA minimum contrast ratio thresholds
    • Rule: color-contrast · Affects 2/24 stories · Learn more
    • WCAG: 1.4.3 (Level AA)

Generated by PR Enrichment workflow | Storybook | Sandbox | View full report

@cixzhang cixzhang 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.

Windows setup still cannot reach browser measurement: setup-measure.mjs keeps calling spawnSync('pnpm', ['build']), even though run-setup.mjs directs every prepared run there. Node cannot launch pnpm's .cmd shim that way, so Windows records a failed build and skips both browser passes. Please route this call through the same cmd.exe path before landing.

[Reviewed by Robohands]

@HelloOjasMutreja
HelloOjasMutreja force-pushed the fix/vibe-tests-spawnsync-pnpm-windows-part2 branch from 7882236 to 95d0017 Compare September 3, 2026 16:20
@HelloOjasMutreja

Copy link
Copy Markdown
Contributor Author

Confirmed and fixed: setup-measure.mjs's build() had the same bare spawnSync('pnpm', ['build']) call. Fixed in the latest commit, same cmd.exe pattern as the other three files. Verified for real (not just source): ran the fixed build() logic against an already-prepared Windows sandbox and got status: 0, ok: true, versus status: null, error: ENOENT from the unfixed bare call against the same sandbox.

@cixzhang cixzhang 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.

Thanks for fixing the measurement build. The same Windows failure remains twice in setup-canonical.test.ts: the real install at line 2141 and build at line 2165 bypass runPnpm and call spawnSync('pnpm', ...) directly. On Windows those cases fail before testing allowBuilds, so the canonical suite still misses its stated path. Please route both through the helper too. If you’d rather talk it through with someone, we’re in Discord.
[Reviewed by Robohands]

Same fix as the one already applied to fixture-suite.mjs, extended to
the other three spots that spawn pnpm directly without shell handling:

- scripts/fixture-browser.mjs (spawnSync, fixtures:contrast/screenshots)
- setup-test/run-setup.mjs (execFileSync, setup:prepare)
- setup-test/setup-canonical.test.ts (execFileSync, its own run()
  helper — gated behind ASTRYX_CANONICAL_SETUP_BROWSER=1, which is set
  by the fixture-contrast CI job, but that job runs on a Linux runner
  so this was silent there)

Same reasoning as before: pnpm is a .cmd batch file on Windows, which
spawnSync/execFileSync can only run through a shell (bare 'pnpm' fails
ENOENT, explicit 'pnpm.cmd' fails EINVAL). Shelling through cmd.exe /c
directly avoids Node's shell-argument-escaping deprecation warning
that plain shell:true would trigger, since every argument here is a
hardcoded literal.

Left the cp -al hardlink calls in run-setup.mjs/setup-canonical.test.ts
alone - confirmed they're a separate, pre-existing Windows breakage
(Unix-only hardlink flag) out of scope for this fix.
….mjs

setup-measure.mjs's build() still called spawnSync('pnpm', ['build'])
directly, the same broken pattern already fixed elsewhere in this PR
(fixture-browser.mjs, run-setup.mjs, setup-canonical.test.ts). Windows
generates pnpm.cmd, which spawnSync can't run without a shell, so the
spawn silently failed and the browser measurement passes never ran.

Verified for real: called the fixed build() logic against an already-
prepared sandbox on Windows and confirmed status: 0, ok: true, where
the unfixed bare spawnSync('pnpm', ...) call reproducibly fails with
status: null, error: ENOENT against the same sandbox.
…hrough cmd.exe too

Same Windows pnpm-spawn bug as the rest of this PR, in the two spots
that intentionally use spawnSync's non-throwing form (a failing
install/build is the assertion under test, not an error) rather than
the throwing runPnpm helper. Adds spawnPnpm as the non-throwing
counterpart with the same cmd.exe routing, and switches both call
sites to it.
@HelloOjasMutreja
HelloOjasMutreja force-pushed the fix/vibe-tests-spawnsync-pnpm-windows-part2 branch from 95d0017 to 05441d0 Compare September 12, 2026 08:38
@HelloOjasMutreja

Copy link
Copy Markdown
Contributor Author

Confirmed and fixed both. Both call sites use spawnSync's non-throwing form deliberately (a failing install/build is the assertion under test at those two spots, not an error), so they can't reuse the throwing runPnpm helper. Added a spawnPnpm counterpart with the same cmd.exe routing and switched both to it.

Verified for real with ASTRYX_CANONICAL_SETUP_BROWSER=1: both "installs and builds when allowBuilds is in pnpm-workspace.yaml" (exercises both the install and build spawns) and "fails exactly as the measured cell did when the key is in package.json" (exercises the install spawn's failure path) pass on Windows.

Fixed in 05441d0.

@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.

Both prior Windows process-launch findings are fixed. The changed install and build paths now route pnpm through cmd.exe on Windows while preserving direct execution elsewhere; focused fixtures, lint, and exact-head CI pass.

@cixzhang
cixzhang merged commit 595cfd3 into meta:main Sep 21, 2026
39 checks passed
cixzhang pushed a commit that referenced this pull request Nov 11, 2026
* test(cli): run the Core rebuild through cmd.exe on Windows

The node global setup rebuilds a stale Core with execFileSync('pnpm').
On Windows pnpm is a pnpm.cmd batch file, which execFileSync can't start
without a shell, so the setup dies with "spawnSync pnpm ENOENT" and no CLI
test runs whenever Core's sources are newer than its build.

Route the call through cmd.exe /d /s /c on win32, the same way the
vibe-tests helpers do since #5841 and #5843. Every argument is a literal,
so this avoids shell: true and its DEP0190 warning. Other platforms are
unchanged.

* test(cli): keep the Core rebuild to one execFileSync call

doc-loads.test.mjs lists each file's child_process sites, and the
platform branch had made two. Pick the executable and its arguments by
platform and keep the single call.

* chore(changeset): note the Windows Core rebuild in the CLI release

ensure-core-built.mjs ships in the @astryxdesign/cli tarball, so the
change needs a CLI patch changeset, as #8567's did for this helper.

This branch was successfully deployed

1 active deployment
Preview — 05441d00 Deployed Sep 12, 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. community Authored by a community contributor (not on the eng/design team) needs:code-review High-risk change (new package/component/API) — needs human code review before merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants