bash: Add tests.withChecks passthru to run tests#435033
bash: Add tests.withChecks passthru to run tests#435033infinisil merged 2 commits intoNixOS:masterfrom
Conversation
balsoft
left a comment
There was a problem hiding this comment.
Actually, just noticed we missed a thing
pkgs/shells/bash/fail-tests.patch
Outdated
| + echo $x | ||
| + if ! sh $x; then | ||
| + echo "Test $x failed" | ||
| + #exit 1 |
f924134 to
2a5b437
Compare
|
Required some changes after the 5.3 update, works again now. @trofi I added myself as a bash maintainer, would you also be okay with adding yourself? You've been doing a great job with maintenance :D. Since you don't have a maintainer entry yet, you'd need to create one in a separate PR though: https://github.com/NixOS/nixpkgs/blob/master/maintainers/maintainer-list.nix |
No, I'll pass. I only have time for small drive-by changes. |
615c2c5 to
83d6249
Compare
|
10 more tests were failing on Darwin, so I now just marked the test derivation as broken on Darwin because I don't want to bother trying to make them work or marking them as broken individually. If we spend more time on this, let's focus on the Linux tests first. I now also changed the test patch to collect all failures instead of just failing at the first one |
83d6249 to
a91997a
Compare
|
@balsoft In addition to addressing your comment (and other improvements to the patch), I removed this: # Fail if diff fails at the end of each test script
for check in tests/run-*; do
# Append "exit $?" at the very end of the file
sed -i '$aexit $?' "$check"
doneEverything works (or fails when expected) as it should, I guess that part isn't necessary after all. As a reminder, all the test files look like ${THIS_SH} ./arith.tests > ${BASH_TSTOUT} 2>&1
diff ${BASH_TSTOUT} arith.right && rm -f ${BASH_TSTOUT}If the |
Co-Authored-By: Alexander Bantyev <[email protected]>
|
@trofi Could you have another look? We now also submitted two of the patches upstream to improve test support: https://lists.gnu.org/archive/html/bug-bash/2025-10/msg00054.html and https://lists.gnu.org/archive/html/bug-bash/2025-10/msg00055.html |
|
I'll merge this, we can improve this over time if necessary |
Issue introduced in NixOS#435033 in 305c5f1
Allows running bash tests with
This notably fails if a test fails, which is not a given with bash tests!
Note also that we can't run the tests by default (without other hacks) because the tests depend on a bunch of packages with bash as a dependency.
Note also that we had to disable some tests for now. In the future we could figure out how to make those work too.
CC @balsoft @trofi
Things done
passthru.tests.nixpkgs-reviewon this PR. See nixpkgs-review usage../result/bin/.Add a 👍 reaction to pull requests you find important.