Skip to content

test: make ecosystem CLI checks portable on Windows - #2431

Open
huanglianggit wants to merge 1 commit into
openai:mainfrom
huanglianggit:fix/windows-ecosystem-cli-tests
Open

test: make ecosystem CLI checks portable on Windows#2431
huanglianggit wants to merge 1 commit into
openai:mainfrom
huanglianggit:fix/windows-ecosystem-cli-tests

Conversation

@huanglianggit

Copy link
Copy Markdown
Contributor

Problem

tests/ecosystem-cli.test.ts fails on Windows even though its assertions are platform-independent. A CRLF checkout prevents the workflow-condition helper from finding the if block, and the fake npm command is written only as a POSIX executable, while Windows command resolution expects npm.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

  • Normalize workflow line endings before extracting jobs.
  • Add an explicit CRLF regression.
  • Write the successful npm fixture as npm.cmd on 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.ts
  • pnpm exec oxlint tests/ecosystem-cli.test.ts
  • pnpm exec tsc --pretty false
  • pnpm build

Compatibility / Risk

Test-only change. SDK runtime behavior and exports are unchanged. POSIX fixtures keep their existing shell-script behavior; Windows uses the native .cmd lookup 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.

@huanglianggit
huanglianggit requested a review from a team as a code owner August 20, 2026 09:00
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