Skip to content

[bug] tests/test_hooks.sh "ix unavailable notification" fails on Git Bash for Windows (exit 127) #20

Description

@josephismikhail

Description

Two tests in the ix unavailable notification section of tests/test_hooks.sh fail on Git Bash for Windows with exit code 127:

── ix unavailable notification ─────────────────────────────────────────────────
FAIL  unavailable/first hook fire emits systemMessage — expected exit 0, got 127
FAIL  unavailable/subsequent hook fires are silent — expected exit 0, got 127

Results: 81 passed, 2 failed

Root cause

tests/test_hooks.sh lines 956–994 simulate "ix not in PATH" by invoking bash hooks/ix-intercept.sh with PATH="/usr/bin:/bin". On Linux/macOS that PATH still contains the basic POSIX utilities the hook needs (jq, cat, etc.). On Git Bash for Windows, those utilities live under /mingw64/bin and /usr/bin/vendor_perl, and /usr/bin:/bin is missing the loader/symlinks needed to launch most binaries — so the hook can't even start and exits 127 before it has a chance to detect ix and emit a systemMessage.

The hook code itself is fine; the test setup is non-portable.

Steps to reproduce

  1. Clone ix-claude-plugin on a Windows machine with Git Bash
  2. bash tests/test_hooks.sh
  3. Observe the two failures above; remaining 81 tests pass

Expected behavior

Either:

  • The test runner detects a non-POSIX-clean PATH environment and skips these two cases with a clear "skip on Windows" message, or
  • The PATH-stripping uses a portable mechanism (e.g. removes only the ix-bin directory from PATH instead of replacing PATH wholesale) so the hook can still run on Git Bash.

Actual behavior

Tests fail with expected exit 0, got 127, which masks any genuine regression in this code path when developers run the suite on Windows.

Environment

  • OS: Windows 11, Git Bash (msys2)
  • Shell: bash 5.x
  • Plugin commit: e92aa16 (current main)

Notes

Originally noticed while running tests/test_hooks.sh for PR #19. These same two failures are present on main independent of that PR, so this is not a regression — just an existing portability gap worth tracking.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions