Re: [PATCH v2 12/12] t: detect errors outside of test cases
- From
Jeff King <peff@peff.net>
- Date
- Apr 16, 2026, 06:00 UTC
- Message-ID
- <20260416060059.GC646814@coredump.intra.peff.net>
- In-Reply-To
- <20260415-b4-pks-tests-with-set-e-v2-12-4e4904a96f15@pks.im>
On Wed, Apr 15, 2026 at 03:06:45PM +0200, Patrick Steinhardt wrote:
Show 7 quoted lines
> Improve the status quo by enabling the errexit option so that any such > unchecked failures will cause us to abort immediately. > > Note that for now, we only enable this option for Bash 5 and newer. This > is because other shells have wildly different behaviour, and older > versions of Bash (especially on macOS) are buggy. The list of enabled > shells may be extended going forward.
OK, we know that this does not cause false positives because all of the tests should pass. It would be nice if we could verify that it catches bugs, too. Doing this:
diff --git a/t/t0001-init.sh b/t/t0001-init.sh index e4d32bb4d2..5521f21e64 100755 --- a/t/t0001-init.sh +++ b/t/t0001-init.sh @@ -980,4 +980,6 @@ test_expect_success 're-init reads matching includeIf.onbranch' ' test_cmp expect err ' +test_expect_foobar 'baz' + test_done will fail for me, but only if I specially ask to use bash, either manually or by setting TEST_SHELL_PATH (since /bin/sh is dash on Debian). Is there something in both GitHub and GitLab CI that will reliably use an acceptable version of bash? I guess perhaps Windows, though I don't know what version is used there. But should we maybe set TEST_SHELL_PATH in at least one of the linux builds? -Peff