test: make ecosystem CLI checks portable on Windows - #2431
Open
huanglianggit wants to merge 1 commit into
Open
Conversation
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
tests/ecosystem-cli.test.tsfails on Windows even though its assertions are platform-independent. A CRLF checkout prevents the workflow-condition helper from finding theifblock, and the fake npm command is written only as a POSIX executable, while Windows command resolution expectsnpm.cmd.Baseline on Windows: 5 failed, 12 passed.
Root cause
The test helper parses workflow text with LF-only delimiters, and the subprocess fixture installs only an extensionless shell script on
PATH.Fix
npm.cmdon Windows while preserving the existing POSIX stub elsewhere.Tests
pnpm exec vitest run --config vitest.config.mts --update=none tests/ecosystem-cli.test.ts --reporter=verbose(18 passed)pnpm exec vitest run --config vitest.config.mts --update=none --exclude tests/ecosystem-cloudflare-credential-lifecycle-security.test.ts --reporter=dot(125 files, 3,966 tests passed)pnpm exec oxfmt --check tests/ecosystem-cli.test.tspnpm exec oxlint tests/ecosystem-cli.test.tspnpm exec tsc --pretty falsepnpm buildCompatibility / Risk
Test-only change. SDK runtime behavior and exports are unchanged. POSIX fixtures keep their existing shell-script behavior; Windows uses the native
.cmdlookup path. The broader Windows run excludes the pre-existing credential lifecycle suite because it exercises POSIX file-mode, link, and signal semantics outside this patch.