[PR #3266] [MERGED] test: resolve script paths from file URLs with fileURLToPath on Windows #5687

Closed
opened 2026-10-31 01:08:39 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/3266
Author: @pablodiazjorge
Created: 10/14/2026
Status: ✅ Merged
Merged: 10/15/2026
Merged by: @baron

Base: main ← Head: test/windows-file-url-paths


📝 Commits (5)

  • 5250424 test: resolve worker and CI script paths with fileURLToPath on Windows
  • 7fdf50b test: skip the fake gh lookup failure on Windows
  • f73ad29 test: resolve the release helper and Hopper probe paths with fileURLToPath
  • 51d32fb Merge branch 'main' into test/windows-file-url-paths
  • e534a7c Merge branch 'main' into test/windows-file-url-paths

📊 Changes

4 files changed (+27 additions, -8 deletions)

View changed files

📝 tests/boundary/evm/solidityMetadataWorker.test.ts (+7 -2)
📝 tests/boundary/filesystem/ciChangeScope.test.ts (+16 -4)
📝 tests/boundary/filesystem/releaseWorkflow.test.ts (+2 -1)
📝 tests/boundary/providers/hopper/hopperBridgeFacade.test.ts (+2 -1)

📄 Description

Summary

Four boundary test files turn a module-relative file: URL into a path with new URL(...).pathname. On Windows that yields /C:/..., which Node then resolves as C:\C:\..., so 13 tests always fail there before reaching the code they test: the eight Solidity metadata worker tests (Cannot find module 'C:\C:\...\dist\evm\EvmoleInterfaceWorker.js'), three CI change-scope tests (required.mjs and baseline.mjs), the release workflow test (release-npm-tag.mjs) and the Hopper bridge facade test, which hands /C:/... paths to python3. The CI change-scope file already uses fileURLToPath for its other scripts.

Problem and expected behavior

Smallest trigger, on native Windows: npx vitest run tests/boundary/evm/solidityMetadataWorker.test.ts tests/boundary/filesystem/ciChangeScope.test.ts tests/boundary/filesystem/releaseWorkflow.test.ts tests/boundary/providers/hopper/hopperBridgeFacade.test.ts on 29d3dcb7e: 13 failed. Expected: the tests exercise the worker, the CI and release scripts and the Hopper probe as they do on Linux and macOS.

Change and scope

  • tests/boundary/evm/solidityMetadataWorker.test.ts: the worker path uses fileURLToPath.
  • tests/boundary/filesystem/ciChangeScope.test.ts: the required.mjs and both baseline.mjs paths use fileURLToPath, as plan.mjs already does in the same file.
  • tests/boundary/filesystem/releaseWorkflow.test.ts and tests/boundary/providers/hopper/hopperBridgeFacade.test.ts: the release helper path and the Hopper probe and bridge paths use fileURLToPath (raised in review). After this, no test passes the .pathname of a module-relative file URL to a child process.
  • selects only a trusted successful ancestor from recent CI push runs and returns an empty baseline when GitHub lookup fails put a POSIX shell script on PATH as a fake gh, which Windows cannot execute, so both now skip themselves on Windows through the test context (skip(process.platform === "win32", ...)), with the reason in the skip note. Without the skip, the second test would pass on Windows for the wrong reason: baseline.mjs falls through to a real gh.exe when one is on PATH, or fails to start gh at all.

Not included: no production code changes. scripts/verify-package-evidence.mjs passes its URL to import(), which already works on Windows.

Contribution scope: not applicable (test portability).

Contract and boundary impact

  • Semantic owner and earliest changed stage: the four test files only.
  • Contribution scope fit and linked maintainer decision: not applicable.
  • CLI and MCP/tool-catalog contract: none.
  • Provider, bridge, target-format, or platform compatibility: the tests now run on Windows; Linux and macOS resolve the same paths as before.
  • Evidence, artifact, provenance, or reconstruction contract: none.
  • Target selection, authority, upstream behavior, and cleanup details (if applicable): none.
  • Generated metadata (docs/public/product-catalog.json), package, or installation impact: none.

Expected effects:

  • Read existing files or captured data.
  • Launch or attach to a process.
  • Inject instrumentation or run scripts/code.
  • Change process memory, registers, files, or configuration.
  • Contact network services.
  • Recover protected code or work around protections.
  • Documentation or usability only; no target interaction.
  • Not sure yet; investigation or maintainer guidance needed.

Evidence and regression coverage

  • Tests added or updated: the four files above; no assertion changes.
  • Base reproduction or other evidence: on 29d3dcb7e on Windows, the 13 tests fail with the C:\C:\... module paths quoted above, or with /C:/... script paths passed to python3.
  • User-visible CLI/MCP output (if applicable): not applicable.
  • Remaining proof gaps: macOS not run locally; fileURLToPath returns the same POSIX path as .pathname for these unescaped paths. On the Windows host used here, python3 is only the Microsoft Store alias, so the Hopper facade test still cannot run end to end there; the same probe, run with Python 3.10.11 and the new paths, exits 0 with its JSON report, and fails with the old /C:/... paths.

Validation performed

  • Windows 11 x64 (10.0.26300), Node 24.18.0, after npm run build:cached: the four files, 223 passed, 25 skipped (the two fake-gh tests and the release workflow's existing Windows skips) and 1 failed (the Hopper facade test, because python3 is not a real interpreter on this host); on 29d3dcb7e without the change, 13 failed.
  • Windows: python tests/fixtures/hopperBridgeFacadeProbe.py bridge/hopper_bridge.py with Python 3.10.11 and the paths fileURLToPath produces — exit 0.
  • Linux x64 (WSL2 Ubuntu), Node 24.18.0, same commit with the change and npm run build:cached: the four files, 249 passed.
  • npx tsc --noEmit and npm run check:fast — passed.
  • npx oxfmt --check on the changed files — passed; npx oxlint reports only the existing max-params warning on classify.

Compatibility, safety, and release

  • Breaking changes or migration steps: none.
  • Real Hopper/Ghidra, browser, or OS coverage: native Windows and Linux.
  • Package or release metadata impact: none.
  • Security, privacy, process, or containment review: none; test code only.

Author readiness

Human owner: @pablodiazjorge

  • I reviewed the final diff and relevant existing code, understand the change and its edge cases, and take responsibility for the complete PR, including AI-assisted work.
  • I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps.
  • I declare this PR ready for initial maintainer review.

Before merge

  • This PR addresses a concrete problem or an agreed enhancement.
  • Material scope and authority questions are resolved, and any required maintainer scope decision covers the final diff.
  • 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.
  • User-visible CLI/MCP changes include representative output.
  • I checked the final diff for secrets, unrelated cleanup, and unsupported claims.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/morluto/rea/pull/3266 **Author:** [@pablodiazjorge](https://github.com/pablodiazjorge) **Created:** 10/14/2026 **Status:** ✅ Merged **Merged:** 10/15/2026 **Merged by:** [@baron](https://github.com/baron) **Base:** `main` ← **Head:** `test/windows-file-url-paths` --- ### 📝 Commits (5) - [`5250424`](https://github.com/morluto/rea/commit/5250424ad9863a908e6b9016b9736fa4b1a6f31a) test: resolve worker and CI script paths with fileURLToPath on Windows - [`7fdf50b`](https://github.com/morluto/rea/commit/7fdf50bcf2c1d4800c14a8418d2bfd2eb36da9d2) test: skip the fake gh lookup failure on Windows - [`f73ad29`](https://github.com/morluto/rea/commit/f73ad29f23be7ba3a04596fb791e0aadaa388f63) test: resolve the release helper and Hopper probe paths with fileURLToPath - [`51d32fb`](https://github.com/morluto/rea/commit/51d32fb698a4bcd2c4268d5c0c5e5bcbf7edab51) Merge branch 'main' into test/windows-file-url-paths - [`e534a7c`](https://github.com/morluto/rea/commit/e534a7c71645441f7e39c4313e997195f1adbd48) Merge branch 'main' into test/windows-file-url-paths ### 📊 Changes **4 files changed** (+27 additions, -8 deletions) <details> <summary>View changed files</summary> 📝 `tests/boundary/evm/solidityMetadataWorker.test.ts` (+7 -2) 📝 `tests/boundary/filesystem/ciChangeScope.test.ts` (+16 -4) 📝 `tests/boundary/filesystem/releaseWorkflow.test.ts` (+2 -1) 📝 `tests/boundary/providers/hopper/hopperBridgeFacade.test.ts` (+2 -1) </details> ### 📄 Description ## Summary Four boundary test files turn a module-relative `file:` URL into a path with `new URL(...).pathname`. On Windows that yields `/C:/...`, which Node then resolves as `C:\C:\...`, so 13 tests always fail there before reaching the code they test: the eight Solidity metadata worker tests (`Cannot find module 'C:\C:\...\dist\evm\EvmoleInterfaceWorker.js'`), three CI change-scope tests (`required.mjs` and `baseline.mjs`), the release workflow test (`release-npm-tag.mjs`) and the Hopper bridge facade test, which hands `/C:/...` paths to `python3`. The CI change-scope file already uses `fileURLToPath` for its other scripts. ## Problem and expected behavior Smallest trigger, on native Windows: `npx vitest run tests/boundary/evm/solidityMetadataWorker.test.ts tests/boundary/filesystem/ciChangeScope.test.ts tests/boundary/filesystem/releaseWorkflow.test.ts tests/boundary/providers/hopper/hopperBridgeFacade.test.ts` on `29d3dcb7e`: 13 failed. Expected: the tests exercise the worker, the CI and release scripts and the Hopper probe as they do on Linux and macOS. ## Change and scope - `tests/boundary/evm/solidityMetadataWorker.test.ts`: the worker path uses `fileURLToPath`. - `tests/boundary/filesystem/ciChangeScope.test.ts`: the `required.mjs` and both `baseline.mjs` paths use `fileURLToPath`, as `plan.mjs` already does in the same file. - `tests/boundary/filesystem/releaseWorkflow.test.ts` and `tests/boundary/providers/hopper/hopperBridgeFacade.test.ts`: the release helper path and the Hopper probe and bridge paths use `fileURLToPath` (raised in review). After this, no test passes the `.pathname` of a module-relative file URL to a child process. - `selects only a trusted successful ancestor from recent CI push runs` and `returns an empty baseline when GitHub lookup fails` put a POSIX shell script on `PATH` as a fake `gh`, which Windows cannot execute, so both now skip themselves on Windows through the test context (`skip(process.platform === "win32", ...)`), with the reason in the skip note. Without the skip, the second test would pass on Windows for the wrong reason: `baseline.mjs` falls through to a real `gh.exe` when one is on `PATH`, or fails to start `gh` at all. Not included: no production code changes. `scripts/verify-package-evidence.mjs` passes its URL to `import()`, which already works on Windows. Contribution scope: not applicable (test portability). ## Contract and boundary impact - Semantic owner and earliest changed stage: the four test files only. - Contribution scope fit and linked maintainer decision: not applicable. - CLI and MCP/tool-catalog contract: none. - Provider, bridge, target-format, or platform compatibility: the tests now run on Windows; Linux and macOS resolve the same paths as before. - Evidence, artifact, provenance, or reconstruction contract: none. - Target selection, authority, upstream behavior, and cleanup details (if applicable): none. - Generated metadata (`docs/public/product-catalog.json`), package, or installation impact: none. Expected effects: - [ ] Read existing files or captured data. - [ ] Launch or attach to a process. - [ ] Inject instrumentation or run scripts/code. - [ ] Change process memory, registers, files, or configuration. - [ ] Contact network services. - [ ] Recover protected code or work around protections. - [x] Documentation or usability only; no target interaction. - [ ] Not sure yet; investigation or maintainer guidance needed. ## Evidence and regression coverage - Tests added or updated: the four files above; no assertion changes. - Base reproduction or other evidence: on `29d3dcb7e` on Windows, the 13 tests fail with the `C:\C:\...` module paths quoted above, or with `/C:/...` script paths passed to `python3`. - User-visible CLI/MCP output (if applicable): not applicable. - Remaining proof gaps: macOS not run locally; `fileURLToPath` returns the same POSIX path as `.pathname` for these unescaped paths. On the Windows host used here, `python3` is only the Microsoft Store alias, so the Hopper facade test still cannot run end to end there; the same probe, run with Python 3.10.11 and the new paths, exits 0 with its JSON report, and fails with the old `/C:/...` paths. ## Validation performed - Windows 11 x64 (10.0.26300), Node 24.18.0, after `npm run build:cached`: the four files, 223 passed, 25 skipped (the two fake-`gh` tests and the release workflow's existing Windows skips) and 1 failed (the Hopper facade test, because `python3` is not a real interpreter on this host); on `29d3dcb7e` without the change, 13 failed. - Windows: `python tests/fixtures/hopperBridgeFacadeProbe.py bridge/hopper_bridge.py` with Python 3.10.11 and the paths `fileURLToPath` produces — exit 0. - Linux x64 (WSL2 Ubuntu), Node 24.18.0, same commit with the change and `npm run build:cached`: the four files, 249 passed. - `npx tsc --noEmit` and `npm run check:fast` — passed. - `npx oxfmt --check` on the changed files — passed; `npx oxlint` reports only the existing `max-params` warning on `classify`. ## Compatibility, safety, and release - Breaking changes or migration steps: none. - Real Hopper/Ghidra, browser, or OS coverage: native Windows and Linux. - Package or release metadata impact: none. - Security, privacy, process, or containment review: none; test code only. ## Author readiness Human owner: @pablodiazjorge - [x] I reviewed the final diff and relevant existing code, understand the change and its edge cases, and take responsibility for the complete PR, including AI-assisted work. - [x] I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps. - [x] I declare this PR ready for initial maintainer review. ## Before merge - [x] This PR addresses a concrete problem or an agreed enhancement. - [x] Material scope and authority questions are resolved, and any required maintainer scope decision covers the final diff. - [x] The PR has one focused outcome and the title follows `type(scope): outcome`. - [x] Related issue is linked, or the reason for not linking one is stated above. - [x] Tests cover changed observable behavior and meaningful failure paths. - [x] Owning docs, contracts, and generated metadata are updated where needed. - [x] User-visible CLI/MCP changes include representative output. - [x] I checked the final diff for secrets, unrelated cleanup, and unsupported claims. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-31 01:08:39 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
morluto/rea#5687
No description provided.