Repository navigation
Add a live differential test suite against Git Bash - #31
Merged
Merged
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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,/tmpandHOMEhandoff, startup files, and a program driving the shell (bash -c -lwrapper, closed stdin, tree kill).boundary/argv_msys_driveis 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.ps1once to make that copy, thencargo 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: aftertaskkill /T /Fon the shell, thesleepprocesses it started keep running under Git Bash and are gone under gash.boundary/nested_shells_start: gash puts its own folder before/usr/bininPATH, so a nestedbash,shorenv bashis gash, and$BASHnames it.tests/parity/accepted.txtships without entries, because accepting them is your call. To accept them, add these two lines:The last commit adds
sleep 0.3before each kill intests/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:
leaves six NUL bytes before
xinlog. 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?