tests: validate "patch" and "ed" commands once, print meaningful messages#226
tests: validate "patch" and "ed" commands once, print meaningful messages#226marc-hb wants to merge 1 commit intouutils:mainfrom
Conversation
|
This seems unrelated: https://results.pre-commit.ci/run/github/341787720/1778103980.1j7-ePVIRuecaKMwwUj_Qg |
|
With this fix, the |
…ages macOS' /usr/bin/patch and GNU patch have very subtle incompatibilities that cause only some "more advanced" tests to fail in obscure and very time-consuming ways - while other tests pass. In some cases (depending on test threads racing), the lack of newlines in some test data even causes the whole test suite to stall. This fix runs `patch -version` (only once), makes sure the output starts with "GNU patch" and shows a meaningful assert message when not. It also looks for `gpatch` instead of `patch` on macOS and shows a meaningful assert message if either is missing. Fixes: uutils#225 This also provides faster and better feedback when `ed` is missing (see uutils#39) and implements a portable and basic check. Last but not least, this new code is generic enough to support the validation of any other test dependency in the future.
|
Except for this mysterious I just force-pushed practically identical commit 05c139b as a attempt to re-run whatever failed with Also, I lost the successful/green status of https://github.com/uutils/diffutils/actions/runs/25462948803, now workflows need to be approved again :-( EDIT: thanks for re-approving! |
macOS' /usr/bin/patch and GNU patch have very subtle incompatibilities that cause only some "more advanced" tests to fail in obscure and very time-consuming ways - while other tests pass. In some cases (depending on test threads racing), the lack of newlines in some test data even causes the whole test suite to stall.
This fix runs
patch -version(only once), makes sure the output starts with "GNU patch" and shows a meaningful assert message when not. It also looks forgpatchinstead ofpatchon macOS and shows a meaningful assert message if either is missing.Fixes: #225
This also provides faster and better feedback when
edis missing (see #39) and implements a portable and basic check.Last but not least, this new code is generic enough to support the validation of any other test dependency in the future.