Skip to content

Fix template e2e harness on Windows - #1135

Open
Leiruz wants to merge 1 commit into
cloudflare:mainfrom
Leiruz:fix/windows-template-e2e
Open

Leiruz wants to merge 1 commit into
cloudflare:mainfrom
Leiruz:fix/windows-template-e2e

Conversation

@Leiruz

@Leiruz Leiruz commented Aug 29, 2026

Copy link
Copy Markdown

The Playwright harness currently cannot run any template spec on Windows, for two reasons:

  1. testInfo.file.split("/") never matches Windows path separators, so every spec fails with "Template not found". Fixed with path.basename.
  2. Spawning pnpm.cmd without a shell throws EINVAL on current Node versions due to the CVE-2024-27980 hardening. Fixed by enabling shell on win32 only; the spawn arguments are all internally generated (script name and numeric ports).

Verified on Windows 11 / Node 24: d1-template.spec.ts and a new template spec both fail without this change and pass with it. No behaviour change on POSIX platforms: the basename swap is equivalent there, and the shell option remains false.

AI assistance was used in diagnosing and drafting this change; I reviewed, ran, and take responsibility for it.

testInfo.file.split("/") never matches Windows path separators, so every
spec failed with template-not-found; use path.basename. Spawning
pnpm.cmd without a shell now throws EINVAL on current Node
(CVE-2024-27980 hardening); enable shell on win32.

Verified: d1-template.spec.ts and a new template spec pass on Windows
with this change and fail without it.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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.

1 participant