Skip to content

test(scripts): run the target-gc suite on Windows - #385

Merged
emirhanyesilgul merged 1 commit into
pacifio:0.4.1from
emirhanyesilgul:emirhanyesilgul/target-gc-test-windows
Oct 7, 2026
Merged

emirhanyesilgul merged 1 commit into
pacifio:0.4.1from
emirhanyesilgul:emirhanyesilgul/target-gc-test-windows

Conversation

@emirhanyesilgul

Copy link
Copy Markdown
Collaborator

What?

tests/target-gc.test.ts runs on Windows, through Git Bash.

Why?

The suite set PATH to <stubs>:/usr/bin:/bin. On Windows Node can't resolve that, so every case failed with spawnSync bash ENOENT. Since #362, the pre-commit hook's test:contracts fails on every Windows checkout, so no commit gets through the hooks there.

How?

ci:local runs target-gc.sh on Windows through Git Bash too, so the suite should run there rather than be skipped.

  • PATH is now the stubs plus Git Bash's usr/bin (bash and the coreutils the script calls), joined with path.delimiter.
  • usr/bin is found on PATH, or next to Git's cmd/ when the shell isn't Git Bash (PowerShell's PATH usually has only Git\cmd). System32's bash.exe is skipped: that's WSL's.
  • Windows' Path spelling is dropped, so the child sees one PATH.
  • Linux and macOS get the same /usr/bin:/bin as before.

Verified on Windows 11: 6/6 from both Git Bash and PowerShell, test:contracts 268/268, and the full bun run test in the pre-push hook.

Checklist

  • Targets the current version branch (0.4.1)
  • New behaviour has a test; a bug fix has a test that fails without it (the suite itself is the test: 6/6 failed on Windows before)
  • You've run the app and used the change in a window (test-only change)

The suite set PATH to `<stubs>:/usr/bin:/bin`. On Windows Node can't
resolve that, so every case failed with `spawnSync bash ENOENT`, and so
did `test:contracts` in the pre-commit hook on any Windows checkout.

`ci:local` runs target-gc.sh on Windows too, through Git Bash. So the
suite now puts Git Bash's usr/bin (bash plus coreutils, found from PATH
or next to Git's cmd/) after the stubs, joined with the platform's
delimiter. It drops Windows' `Path` spelling so the child sees one PATH.
Linux and macOS get the same `/usr/bin:/bin` as before.
@coderabbitai

coderabbitai Bot commented Oct 7, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 118555d8-990e-4030-828c-816b68bbed41

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

@emirhanyesilgul
emirhanyesilgul merged commit 0ff9e65 into pacifio:0.4.1 Oct 7, 2026
9 checks passed
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