Skip to content

test(ci): resolve helper script paths with fileURLToPath on Windows - #2113

Closed
GamerDubz wants to merge 5 commits into
morluto:mainfrom
GamerDubz:fix/windows-test-script-paths
Closed

GamerDubz wants to merge 5 commits into
morluto:mainfrom
GamerDubz:fix/windows-test-script-paths

Conversation

@GamerDubz

Copy link
Copy Markdown
Contributor

Summary

Three boundary tests fail on a Windows host before reaching their assertions, because they pass a file URL's .pathname to node as a script path. No issue is linked: found while running the release tests locally for #1977.

Problem and expected behavior

Smallest trigger, on Windows: npx vitest run tests/boundary/filesystem/releaseWorkflow.test.ts tests/boundary/filesystem/ciChangeScope.test.ts.

new URL("../../../scripts/x.mjs", import.meta.url).pathname is /C:/…/scripts/x.mjs on Windows. node resolves that to C:\C:\… and exits with MODULE_NOT_FOUND. Expected: the helper script runs and the test reaches its assertions on every platform.

Change and scope

Replace .pathname with fileURLToPath(...) at the three call sites:

  • releaseWorkflow.test.ts — scripts/release-npm-tag.mjs
  • ciChangeScope.test.ts — scripts/ci/plan.mjs and scripts/ci/required.mjs

Not included: the same pattern in tests/boundary/providers/hopper/hopperBridgeFacade.test.ts and scripts/lib/real-hopper-boundaries.mjs, which only run on Hopper hosts. Tests already marked skipIf(process.platform === "win32") are untouched.

Contract and boundary impact

  • Semantic owner and earliest changed stage: not applicable (test-only).
  • CLI and MCP/tool-catalog contract: none.
  • Provider, bridge, target-format, or platform compatibility: none in product code; two test files now run on Windows.
  • Evidence, artifact, provenance, or reconstruction contract: none.
  • Process execution, authorization, cleanup, or containment impact: none.
  • Generated metadata, package, or installation impact: none.

Evidence and regression coverage

  • Tests added or updated: the two files above; no new tests.
  • Base reproduction or other evidence: executed on Windows 11, Node 24.21.0. Before, on main: releaseWorkflow.test.ts 1 failed ("binds npm and MCP publication to the same immutable release SHA") and ciChangeScope.test.ts failed in its plan.mjs and required.mjs tests, all with Cannot find module 'C:\C:\…'. After: both files pass, 67 passed and 23 skipped.
  • User-visible CLI/MCP output: not applicable.
  • Remaining proof gaps: not run on Linux or macOS locally. fileURLToPath returns the same string as .pathname for these POSIX paths, but that is reasoning, not an executed check; CI covers it.

Validation performed

  • npx vitest run tests/boundary/filesystem/releaseWorkflow.test.ts tests/boundary/filesystem/ciChangeScope.test.ts — 67 passed, 23 skipped (Windows).
  • npm run check:fast — passed.
  • oxfmt --check tests/boundary/filesystem — passed.

Not run: npm run check, the full suite, any Linux run.

Compatibility, safety, and release

  • Breaking changes or migration steps: none.
  • Real Hopper/Ghidra, browser, or OS coverage: Windows only, as above.
  • Package or release metadata impact: none.
  • Security, privacy, process, or containment review: none needed; test-only.

Review checklist

  • This PR addresses a concrete problem or an agreed enhancement.
  • The PR has one focused outcome and the title follows type(scope): outcome.
  • Related issue is linked, or the reason for not linking one is stated above.
  • Tests cover changed observable behavior and meaningful failure paths.
  • Owning docs, contracts, and generated metadata are updated where needed. (None needed.)
  • User-visible CLI/MCP changes include representative output. (Not applicable.)
  • I checked the final diff for secrets, unrelated cleanup, and unsupported claims.

🤖 Generated with Claude Code

Three boundary tests passed a file URL's pathname to node as a script
path. On Windows that is "/C:/..." and node resolves it to "C:\C:\...",
so the tests failed with MODULE_NOT_FOUND before reaching their
assertions. Use fileURLToPath so the path is valid on every platform.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 12, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-12T13:28:16.363733Z 416da5e New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@GamerDubz GamerDubz closed this Oct 13, 2026
@morluto morluto added area: tests Test suite and verification area: native Native analysis and decompilation, including Ghidra, IDA, and Hopper analysis behavior labels Oct 14, 2026
@morluto

morluto commented Oct 15, 2026

Copy link
Copy Markdown
Owner

Thanks @GamerDubz for finding that Windows boundary tests passed URL .pathname strings to Node instead of filesystem paths. Main now resolves those helper entry points with fileURLToPath, preserving the intended assertions on Windows (main).

@morluto morluto added the area: build Build, CI, packaging, and publishing label Nov 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: build Build, CI, packaging, and publishing area: native Native analysis and decompilation, including Ghidra, IDA, and Hopper analysis behavior area: tests Test suite and verification

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants