Skip to content

Add a live differential test suite against Git Bash - #31

Merged
hex2f merged 5 commits into
hex2f:mainfrom
ByteSizedMarius:parity-suite
Nov 24, 2026
Merged

hex2f merged 5 commits into
hex2f:mainfrom
ByteSizedMarius:parity-suite

Conversation

@ByteSizedMarius

Copy link
Copy Markdown
Contributor

This PR adds tests/parity, a test suite that runs each case under Git Bash and under gash and compares stdout, stderr, exit code and the files each run leaves behind. It runs the 74 compat scripts and 38 new cases. The new cases test path and argument conversion for child processes, /tmp and HOME handoff, startup files, and a program driving the shell (bash -c -l wrapper, closed stdin, tree kill). boundary/argv_msys_drive is the end-to-end test asked for in the #25 review.

The suite is opt-in, because it needs its own copy of Git for Windows. Run tests/parity/setup-ref.ps1 once to make that copy, then cargo test --test parity -- --ignored.

On main, 110 of the 112 cases pass. The other two fail on differences from Git Bash that look deliberate:

  • host/host_kill_tree: after taskkill /T /F on the shell, the sleep processes it started keep running under Git Bash and are gone under gash.
  • boundary/nested_shells_start: gash puts its own folder before /usr/bin in PATH, so a nested bash, sh or env bash is gash, and $BASH names it.

tests/parity/accepted.txt ships without entries, because accepting them is your call. To accept them, add these two lines:

host/host_kill_tree survivors a tree kill (taskkill /T /F) leaves no gash child alive, MSYS children of Git Bash survive it
boundary/nested_shells_start stdout:"*: BASH=*" gash puts its own folder before /usr/bin in PATH, so nested bash, sh and env bash run gash

The last commit adds sleep 0.3 before each kill in tests/scripts/069_kill_wait_status.sh. Under load, Git Bash reports status 0 for about 1 in 100 jobs killed right after they start, so the script's output differed between Git Bash runs. With the pause it was the same in 1200 of 1200 kills per line.

We left 33 more cases out of this PR, because they fail on main and each needs a fix or a decision. One of them:

exec 3>>log; echo first >&3; : > log; /usr/bin/echo x >&3

leaves six NUL bytes before x in log. Do you have a preference for how to discuss them, if at all? We can open one issue for all of them, or skip that and open one big PR.

Also: We suggest running the suite in a Windows CI job. Do you want us to add one?

claude and others added 5 commits November 15, 2026 15:51
Co-Authored-By: ByteSizedMarius <github@byte.rest>
Assisted-By: Claude Opus 5.5
Co-Authored-By: ByteSizedMarius <github@byte.rest>
Assisted-By: Claude Opus 5.5
Co-Authored-By: ByteSizedMarius <github@byte.rest>
Assisted-By: Claude Opus 5.5
Co-Authored-By: ByteSizedMarius <github@byte.rest>
Assisted-By: Claude Opus 5.5
Co-Authored-By: ByteSizedMarius <github@byte.rest>
Assisted-By: Claude Opus 5.5
@hex2f
hex2f merged commit 14328cd into hex2f:main Nov 24, 2026
1 check 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.

3 participants