tests: validate "patch" and "ed" commands once, print meaningful messages#226
Open
marc-hb wants to merge 1 commit intouutils:mainfrom
Open
tests: validate "patch" and "ed" commands once, print meaningful messages#226marc-hb wants to merge 1 commit intouutils:mainfrom
marc-hb wants to merge 1 commit intouutils:mainfrom
Conversation
…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: #TODO 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.
Author
|
This seems unrelated: https://results.pre-commit.ci/run/github/341787720/1778103980.1j7-ePVIRuecaKMwwUj_Qg |
Author
|
With this fix, the |
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.
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.