git/list[1] front-page[2] threads[3] people[4] search[5] about
 

RE: [Test Breakage 2.46.0-rc0] Test t0021.35 fails on NonStop

From
rsbecker@nexbridge.com <rsbecker@nexbridge.com>
Date
Jul 15, 2024, 15:32 UTC
Message-ID
<00af01dad6cc$41f10d40$c5d327c0$@nexbridge.com>
In-Reply-To
<xmqqv8167kd8.fsf@gitster.g>
On Monday, July 15, 2024 11:20 AM, Junio C Hamano wrote:
Show 8 quoted lines
>"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
Show 8 quoted lines
>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
Show 7 quoted lines
>        # 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"' '
Show 11 quoted lines
>                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
Show 9 quoted lines
>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
Show 5 quoted lines
>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".
Show 6 quoted lines
>-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
Show 18 quoted lines
>"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.

What is strange is that when running on NonStop using ksh, t0000.1 has never failed. I think the situation is subtly different from what we are solving. My take is that there is a difference in the local vs. non-local variable set semantic, rather than just accepting the keyword. I would propose that we need a more comprehensive local test to verify the actual expected semantics rather than just testing the syntax.

Previous: Junio C HamanoNext: Junio C Hamano
Message 11 of 18 in “[Test Breakage 2.46.0-rc0] Test t0021.35 fails on NonStop”
  1. rsbecker@nexbridge.comJul 13, 2024
  2. Junio C HamanoJul 14, 2024
  3. rsbecker@nexbridge.comJul 14, 2024
  4. Junio C HamanoJul 14, 2024
  5. rsbecker@nexbridge.comJul 14, 2024
  6. brian m. carlsonJul 14, 2024
  7. rsbecker@nexbridge.comJul 14, 2024
  8. brian m. carlsonJul 14, 2024
  9. rsbecker@nexbridge.comJul 14, 2024
  10. Junio C HamanoJul 15, 2024
  11. rsbecker@nexbridge.comJul 15, 2024
  12. Junio C HamanoJul 15, 2024
  13. rsbecker@nexbridge.comJul 15, 2024
  14. Junio C HamanoJul 15, 2024
  15. rsbecker@nexbridge.comJul 15, 2024
  16. Junio C HamanoJul 15, 2024
  17. Eric SunshineJul 14, 2024
  18. rsbecker@nexbridge.comJul 14, 2024

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.