Skip to content

test(bash-tools): fix Windows CI path prepend assertion#26049

Closed
drvoss wants to merge 1 commit intoopenclaw:mainfrom
drvoss:fix/windows-ci-bash-tools-path-test
Closed

test(bash-tools): fix Windows CI path prepend assertion#26049
drvoss wants to merge 1 commit intoopenclaw:mainfrom
drvoss:fix/windows-ci-bash-tools-path-test

Conversation

@drvoss
Copy link
Contributor

@drvoss drvoss commented Feb 25, 2026

Summary

Fix a pre-existing Windows CI test failure in bash-tools.test.ts. The test for "prepends configured path entries" assumed the custom prepend entries would be at positions 0-N of the PATH, but Windows CI runners inject additional directories (e.g. C:\Program Files\PowerShell\7) before the test-managed entries.

The fix uses indexOf to locate where our custom entries start, then verifies they appear contiguously before the base PATH entry.

This failure affected every PR that runs the Node test suite on Windows.

Change Type

  • Bug fix (non-breaking)

Scope

  • Tests only

Linked Issue

N/A — pre-existing test environment issue

User-visible Changes

No user-visible changes.

Security Impact (required)

No security impact. Test file only.

Repro + Verification

  1. Run pnpm test src/agents/bash-tools.test.ts on a Windows machine where PowerShell 7 is installed and in PATH.
  2. Before: fails with AssertionError: expected ["C:\\Program Files\\PowerShell\\7", "C:\\custom\\bin"] to deeply equal ["C:\\custom\\bin", "C:\\oss\\bin"]
  3. After: test passes.

Evidence

CI log from multiple PRs (#25140, #25152) showing identical failure:

FAIL src/agents/bash-tools.test.ts > exec PATH handling > prepends configured path entries
AssertionError: expected [ …(2) ] to deeply equal [ 'C:\custom\bin', 'C:\oss\bin' ]
+ "C:\\Program Files\\PowerShell\\7",
  "C:\\custom\\bin",
- "C:\\oss\\bin",

Human Verification (required)

  • I have reviewed the test change and confirmed it still correctly validates that custom path entries are prepended before the base PATH entry.

Compatibility

No compatibility impact. Test-only change.

Failure Recovery

N/A

Risks

Low. Test-only change.


AI-assisted: This PR was prepared with GitHub Copilot assistance and reviewed for correctness.

Greptile Summary

Fixed Windows CI test failure in bash-tools.test.ts where the PATH prepend assertion assumed custom entries would start at index 0. Windows CI runners inject additional paths (like C:\Program Files\PowerShell\7) before test-managed entries. The fix uses indexOf to locate custom prepend entries and verifies they appear contiguously before the base PATH entry.

Confidence Score: 5/5

  • This PR is safe to merge with no risk
  • Test-only change that fixes a pre-existing Windows CI failure by making PATH assertion more robust. The fix properly locates custom prepend entries and validates their relative ordering, which is the intended behavior. No production code is affected.
  • No files require special attention

Last reviewed commit: 386b60a

Windows CI runners inject extra directories (e.g. PowerShell 7) at the
start of PATH before the test-prepended entries. Use indexOf to locate
where the custom prepend entries begin rather than assuming position 0.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@arosstale

This comment was marked as spam.

@Takhoffman Takhoffman added the close:superseded PR close reason label Mar 2, 2026
@Takhoffman
Copy link
Contributor

Closing as superseded.

Equivalent Windows PATH-prepend stabilization already landed on main in dd6ad0d and was further hardened in 21708f5.
No additional behavior from this PR remains unique.

@Takhoffman Takhoffman closed this Mar 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling close:superseded PR close reason size: XS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants