git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: "brian m. carlson" <sandals@crustytoothpaste.net>
Cc: rsbecker@nexbridge.com,  git@vger.kernel.org
Subject: Re: [Test Breakage 2.46.0-rc0] Test t0021.35 fails on NonStop
Date: Mon, 15 Jul 2024 08:20:03 -0700	[thread overview]
Message-ID: <xmqqv8167kd8.fsf@gitster.g> (raw)
In-Reply-To: <ZpRKu8Xsz70xNHFp@tapette.crustytoothpaste.net> (brian m. carlson's message of "Sun, 14 Jul 2024 22:01:31 +0000")

"brian m. carlson" <sandals@crustytoothpaste.net> writes:

> I think we had discussed that you were using AT&T ksh on NonStop, which
> would explain the situation.  That's the most common version of ksh on
> proprietary Unix systems, and you can usually detect it with something
> like this:

What is sad is that we have this as literally the very first thing
in our test suite, as t0000.1, but ...

        try_local_xy () {
                local x="local" y="alsolocal" &&
                echo "$x $y"
        }

        # Check whether the shell supports the "local" keyword. "local" is not
        # POSIX-standard, but it is very widely supported by POSIX-compliant
        # shells, and we rely on it within Git's test framework.
        #
        # If your shell fails this test, the results of other tests may be
        # unreliable. You may wish to report the problem to the Git mailing
        # list <git@vger.kernel.org>, as it could cause us to reconsider
        # relying on "local".
        test_expect_success 'verify that the running shell supports "local"' '
                x="notlocal" &&
                y="alsonotlocal" &&
                echo "local alsolocal" >expected1 &&
                try_local_xy >actual1 &&
                test_cmp expected1 actual1 &&
                echo "notlocal alsonotlocal" >expected2 &&
                echo "$x $y" >actual2 &&
                test_cmp expected2 actual2
        '

... apparently it is just like any other test failure, so unless the
tester is running

	$ shell t0000-basic.sh -i

reading the output, *AND* goes to the test script to read that
comment, the helpful comment can easily be missed.

I am wondering if it is worth doing something like this.


 t/t0000-basic.sh | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git c/t/t0000-basic.sh w/t/t0000-basic.sh
index 98b81e4d63..3cb8243cb4 100755
--- c/t/t0000-basic.sh
+++ w/t/t0000-basic.sh
@@ -34,7 +34,7 @@ try_local_xy () {
 # unreliable. You may wish to report the problem to the Git mailing
 # list <git@vger.kernel.org>, as it could cause us to reconsider
 # relying on "local".
-test_expect_success 'verify that the running shell supports "local"' '
+test_lazy_prereeq WORKING_LOCAL '
 	x="notlocal" &&
 	y="alsonotlocal" &&
 	echo "local alsolocal" >expected1 &&
@@ -45,6 +45,17 @@ test_expect_success 'verify that the running shell supports "local"' '
 	test_cmp expected2 actual2
 '
 
+if ! test_have_prereq WORKING_LOCAL
+then
+	skip_all='
+		Your shell has no working "local", no tests will work.
+		You may wish to report the problem to the Git mailing
+		list <git@vger.kernel.org>, unless it is AT&T ksh,
+		which we know lacks "local".  In the meantime, use
+		shells that support "local", like dash, bash, pdksh...'
+	test_done
+fi
+
 ################################################################
 # git init has been done in an empty repository.
 # make sure it is empty.

  parent reply	other threads:[~2024-07-15 15:20 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-13 16:38 [Test Breakage 2.46.0-rc0] Test t0021.35 fails on NonStop rsbecker
2024-07-14  2:53 ` Junio C Hamano
2024-07-14 13:29   ` rsbecker
2024-07-14 17:00     ` Junio C Hamano
2024-07-14 17:29       ` rsbecker
2024-07-14 18:15       ` brian m. carlson
2024-07-14 18:28         ` rsbecker
2024-07-14 22:01           ` brian m. carlson
2024-07-14 22:14             ` rsbecker
2024-07-15 15:20             ` Junio C Hamano [this message]
2024-07-15 15:32               ` rsbecker
2024-07-15 16:41                 ` Junio C Hamano
2024-07-15 17:39                   ` rsbecker
2024-07-15 18:33                     ` Junio C Hamano
2024-07-15 19:03                       ` rsbecker
2024-07-15 15:05         ` Junio C Hamano
2024-07-14 21:27       ` Eric Sunshine
2024-07-14 13:58   ` rsbecker

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xmqqv8167kd8.fsf@gitster.g \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=rsbecker@nexbridge.com \
    --cc=sandals@crustytoothpaste.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).