Skip to content

test(cli): make path assertions OS-agnostic#2990

Merged
jorgemoya merged 1 commit intocanaryfrom
jorgemoya/ltrac-594-cli-tests-fail-on-windows-due-to-hardcoded-posix-path
Apr 23, 2026
Merged

test(cli): make path assertions OS-agnostic#2990
jorgemoya merged 1 commit intocanaryfrom
jorgemoya/ltrac-594-cli-tests-fail-on-windows-due-to-hardcoded-posix-path

Conversation

@jorgemoya
Copy link
Copy Markdown
Contributor

Jira: LTRAC-594

What/Why?

CLI Tests (windows-latest) started failing on the Basic workflow. Four tests in packages/catalyst/src/cli/commands/{build,dev,start}.spec.ts assert that execa is invoked with a specific path string, but they hardcoded POSIX separators (node_modules/.bin/next, .bigcommerce/wrangler.jsonc) while the production code builds those paths with path.join, which returns \-separated paths on Windows.

The ubuntu and macOS matrix legs still pass because their separator matches. This was latent until the GitHub windows-latest runner image rolled from 20260405.77.120260413.84.1 between 2026-04-14 (last green canary run) and 2026-04-23 (first red PR run) — same CLI source, different observed arg through the Vitest spy.

Fix: build the expected path in the spec via join(...) too, so the assertion mirrors production and matches whatever separator the current OS produces.

Surfaced by PR #2989 (LTRAC-578). The failure was not caused by that PR.

Rollout/Rollback

  • Test-only change in @bigcommerce/catalyst (which is in the changeset ignore list), so no release is cut and no changeset is needed.
  • Rollback is a straight revert.

Testing

  • pnpm --filter @bigcommerce/catalyst test locally on macOS: all 44 tests pass, including the 4 previously Windows-only failing ones.
  • On CI, verify all three CLI Tests matrix legs (ubuntu / windows / macos) go green.

Fixes LTRAC-594
Refs LTRAC-578

@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 23, 2026

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

Project Deployment Actions Updated (UTC)
catalyst Ready Ready Preview, Comment Apr 23, 2026 10:59pm

Request Review

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Apr 23, 2026

⚠️ No Changeset found

Latest commit: f23274e

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@github-actions
Copy link
Copy Markdown
Contributor

Bundle Size Report

Comparing against baseline from be980da (2026-04-23).

No bundle size changes detected.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 23, 2026

Unlighthouse Performance Comparison — Vercel

Comparing PR preview deployment Unlighthouse scores vs production Unlighthouse scores.

Summary Score

Aggregate score across all categories as reported by Unlighthouse.

Prod Desktop Prod Mobile Preview Desktop Preview Mobile
Score 90 93 91 95

Category Scores

Category Prod Desktop Prod Mobile Preview Desktop Preview Mobile
Performance 77 77 71 84
Accessibility 95 95 95 95
Best Practices 100 100 95 100
SEO 88 88 88 100

Core Web Vitals

Metric Prod Desktop Prod Mobile Preview Desktop Preview Mobile
LCP 3.5 s 4.2 s 5.3 s 4.5 s
CLS 0.001 0.184 0.037 0
FCP 1.2 s 1.2 s 1.2 s 1.2 s
TBT 0 ms 0 ms 0 ms 10 ms
Max Potential FID 40 ms 40 ms 40 ms 60 ms
Time to Interactive 3.6 s 4.2 s 5.3 s 4.5 s

Full Unlighthouse report →

@jorgemoya jorgemoya marked this pull request as ready for review April 23, 2026 22:47
@jorgemoya jorgemoya requested a review from a team as a code owner April 23, 2026 22:47
@jorgemoya jorgemoya added this pull request to the merge queue Apr 23, 2026
@jorgemoya jorgemoya removed this pull request from the merge queue due to a manual request Apr 23, 2026
@jorgemoya jorgemoya force-pushed the jorgemoya/ltrac-594-cli-tests-fail-on-windows-due-to-hardcoded-posix-path branch from 78e2118 to 6787b09 Compare April 23, 2026 22:56
@jorgemoya jorgemoya changed the title LTRAC-594: test(cli) - Make path assertions OS-agnostic test(cli) - Make path assertions OS-agnostic Apr 23, 2026
@jorgemoya jorgemoya enabled auto-merge April 23, 2026 22:56
@jorgemoya jorgemoya disabled auto-merge April 23, 2026 22:57
@jorgemoya jorgemoya changed the title test(cli) - Make path assertions OS-agnostic test(cli): make path assertions OS-agnostic Apr 23, 2026
The spec files for the `build`, `dev`, and `start` CLI commands asserted
that execa was called with `'node_modules/.bin/next'` (and
`'.bigcommerce/wrangler.jsonc'` in the OpenNext case) using POSIX
separators. Production code builds these paths via Node's `path.join`,
which returns `\`-separated paths on Windows, so the assertions fail on
`CLI Tests (windows-latest)`.

Import `join` in each spec and build the expected path the same way the
production code does, so the assertions match regardless of OS.

Fixes LTRAC-594

Co-Authored-By: Claude <noreply@anthropic.com>
@jorgemoya jorgemoya force-pushed the jorgemoya/ltrac-594-cli-tests-fail-on-windows-due-to-hardcoded-posix-path branch from 6787b09 to f23274e Compare April 23, 2026 22:58
@jorgemoya jorgemoya enabled auto-merge April 23, 2026 22:59
@jorgemoya jorgemoya added this pull request to the merge queue Apr 23, 2026
Merged via the queue into canary with commit 225c4ef Apr 23, 2026
16 of 17 checks passed
@jorgemoya jorgemoya deleted the jorgemoya/ltrac-594-cli-tests-fail-on-windows-due-to-hardcoded-posix-path branch April 23, 2026 23:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants