fix: rewrite GNU testsuite harness to run upstream test scripts directly#343
Open
kevinburkesegment wants to merge 3 commits intouutils:mainfrom
Open
fix: rewrite GNU testsuite harness to run upstream test scripts directly#343kevinburkesegment wants to merge 3 commits intouutils:mainfrom
kevinburkesegment wants to merge 3 commits intouutils:mainfrom
Conversation
Author
|
Here's the example output from a test run on my Macbook Pro |
|
GNU sed testsuite comparison: |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #343 +/- ##
=======================================
Coverage 82.07% 82.07%
=======================================
Files 13 13
Lines 5445 5445
Branches 293 293
=======================================
Hits 4469 4469
Misses 974 974
Partials 2 2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Contributor
|
small problem here :) |
The previous harness tried to extract sed commands from GNU test scripts via regex pattern matching, which produced false negatives (comparing against empty expected output) and false positives. This led to inflated test counts and unreliable pass/fail signals. The new approach: - Provides a lightweight shim for the gnulib test framework (init.sh) with implementations of compare_, returns_, skip_, framework_failure_, and all require_* functions - Executes each .sh test script from the GNU testsuite directly, injecting our Rust sed binary via PATH - Uses a clean srcdir with symlinks to real test data files - Adds 30s timeout per test to catch infinite loops - Properly propagates exit codes (0=pass, 77=skip, 99=framework failure) Results are now consistent with CI: 65 tests, ~12% pass rate, with clear PASS/FAIL/SKIP/timeout categorization. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
7a0ac5c to
f3ed0cd
Compare
Author
|
Sorry - give it another try |
Contributor
|
it is fine, don't be sorry :) |
When a test hangs and the watchdog kills the shell, orphaned child processes (e.g. our sed binary in an infinite loop) can keep a pipe's write end open, causing the $() subshell capture to block indefinitely. Switch to writing test output to a temp file instead of capturing via pipe. This ensures the parent script always returns promptly after the watchdog fires, regardless of orphaned processes. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Author
|
one more try please! |
Contributor
|
done! |
The previous approach (background process + manual watchdog) left orphaned sed processes that could block the script or cause the CI runner to kill the entire step (exit code 143). Switch to running `timeout --kill-after=5 30` in the foreground with output redirected to a file. This lets timeout properly manage the child process tree and avoids pipe-blocking issues entirely. Also detect exit code 125 (uutils timeout) in addition to 124 (GNU coreutils timeout) and 137 (SIGKILL). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
8fe8ac8 to
fbf8f5f
Compare
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.
The previous harness tried to extract sed commands from GNU test scripts via regex pattern matching, which produced false negatives (comparing against empty expected output) and false positives. This led to inflated test counts and unreliable pass/fail signals.
The new approach:
Results are now consistent with CI: 65 tests, ~12% pass rate, with clear PASS/FAIL/SKIP/timeout categorization.