Repository navigation
test: start pnpm through a shell on Windows in ensureBuilt - #3177
Open
RafalOfficial wants to merge 1 commit into
Open
RafalOfficial wants to merge 1 commit into
RafalOfficial wants to merge 1 commit into
Conversation
ensureBuilt ran `pnpm build` with execFile, which cannot start the pnpm.cmd shim on Windows, so every suite that needs a built dist failed there with `spawn pnpm ENOENT`. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@modelcontextprotocol/client
@modelcontextprotocol/codemod
@modelcontextprotocol/core
@modelcontextprotocol/server
@modelcontextprotocol/server-legacy
@modelcontextprotocol/express
@modelcontextprotocol/fastify
@modelcontextprotocol/hono
@modelcontextprotocol/node
commit: |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
On Windows, the unit suite fails from a checkout without built
distdirectories.ensureBuilt(the test helper inpackages/clientandpackages/server) runspnpm buildwithexecFile. On Windowspnpmis apnpm.cmdshim, andexecFilecan only start that through a shell, so the build never runs:Every suite that needs a built dist fails this way (client:
barrelClean,coreBoundary,workerdSchemaPreload; server:barrelClean,workerdSchemaPreload). Withpnpm -r testthe client failure also stops the run before the middleware and integration packages are tested. CI runs on Ubuntu only, so it does not see this.Fix
Pass
shell: process.platform === 'win32'to theexecFilecall in both helpers. Nothing changes on other platforms. Test code only, so no changeset.Testing
Windows 11, Node 24.16.0, pnpm 10.26.1, with this commit applied on current
main(919bb8e), after deleting everypackages/*/dist. The branch itself is based on the older 9bc40e9; neither helper has changed since, and it merges cleanly:pnpm --filter @modelcontextprotocol/client test→ 3 files fail withspawn pnpm ENOENT.pnpm -r --filter '!@modelcontextprotocol/test-e2e' test(the CI command) → all packages pass (client 44 files / 1078 tests, server 55 files / 672 tests).pnpm --filter @modelcontextprotocol/client --filter @modelcontextprotocol/server lintandtypecheck→ clean.One side effect, on Windows only: Node 24 prints the
DEP0190warning (args passed together withshell: true) when the helper has to build. The arguments are the constant['build']. I did not test on Linux or macOS; the option isfalsethere.AI disclosure
This change was found, written and tested with Claude Code (an AI coding agent) running on a Windows machine.
🤖 Generated with Claude Code