{"thread":{"id":"53338","subject":"t0000 failed","startedAt":"2020-04-28T06:52:49Z","lastAt":"2020-05-01T20:56:59Z","messageCount":3,"participants":["Son Luong Ngoc","Jeff King","Johannes Schindelin"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"396439","messageId":"CAL3xRKc6Q1m=9XJYcafhczCU+ONYjapkUgBi0nKMFoMr+bgjYg@mail.gmail.com","threadId":"53338","inReplyTo":null,"subject":"t0000 failed","fromName":"Son Luong Ngoc","fromEmail":"sluongng@gmail.com","sentAt":"2020-04-28T06:52:34Z","receivedAt":"2020-04-28T06:52:49Z","isPatch":false,"sender":{"key":"sluongng@gmail.com","avatar":"https://avatars.githubusercontent.com/u/26684313?v=4"},"body":"Hey folks,\n\nRunning t0000 with GIT_TEST_FAIL_PREREQS=true is failing.\n\n> GIT_TEST_FAIL_PREREQS=true ./t0000-basic.sh\nt/./t0000-basic.sh:836: error: not ok 45 - lazy prereqs do not turn off tracing\n#\n#               run_sub_test_lib_test lazy-prereq-and-tracing\n 'lazy prereqs and -x' -v -x <<-\\EOF &&\n#               test_lazy_prereq LAZY true\n#\n#               test_expect_success lazy 'test_have_prereq LAZY && echo trace'\n#\n#               test_done\n#               EOF\n#\n#               grep 'echo trace' lazy-prereq-and-tracing/err\n#\n\nThis was added recently with\nhttps://public-inbox.org/git/f35830c0eba216b7b4f144409e302a87ff8b5c06.1585236929.git.gitgitgadget@gmail.com/\nIs this intended?\n\nCheers,\nSon Luong.\n"},{"id":"396443","messageId":"20200428081421.GA2381876@coredump.intra.peff.net","threadId":"53338","inReplyTo":"CAL3xRKc6Q1m=9XJYcafhczCU+ONYjapkUgBi0nKMFoMr+bgjYg@mail.gmail.com","subject":"[PATCH] t0000: disable GIT_TEST_FAIL_PREREQS in sub-tests","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2020-04-28T08:14:21Z","receivedAt":"2020-04-28T08:14:24Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Tue, Apr 28, 2020 at 08:52:34AM +0200, Son Luong Ngoc wrote:\n\n> Running t0000 with GIT_TEST_FAIL_PREREQS=true is failing.\n> \n> > GIT_TEST_FAIL_PREREQS=true ./t0000-basic.sh\n> t/./t0000-basic.sh:836: error: not ok 45 - lazy prereqs do not turn off tracing\n> #\n> #               run_sub_test_lib_test lazy-prereq-and-tracing\n>  'lazy prereqs and -x' -v -x <<-\\EOF &&\n> #               test_lazy_prereq LAZY true\n> #\n> #               test_expect_success lazy 'test_have_prereq LAZY && echo trace'\n> #\n> #               test_done\n> #               EOF\n> #\n> #               grep 'echo trace' lazy-prereq-and-tracing/err\n\nI think the patch below is the right fix.\n\n-- >8 --\nSubject: [PATCH] t0000: disable GIT_TEST_FAIL_PREREQS in sub-tests\n\nThe test added by 477dcaddb6 (tests: do not let lazy prereqs inside\n`test_expect_*` turn off tracing, 2020-03-26) runs a sub-test script\nthat traces a test with a lazy prereq, like:\n\n  test_have_prereq LAZY && echo trace\n\nThat won't work if GIT_TEST_FAIL_PREREQS is set in the environment,\nbecause our have_prereq will report failure, and we won't run the echo\nat all.\n\nWe could work around this by avoiding the &&-chain, but we can\nfix this and any future tests at once by unsetting that variable for our\nsub-tests. These are meant to be controlled environments where we test\nthe test-suite itself; the outer test snippet should be in charge of the\nsub-test environment, not whatever mode the user happens to be running\nin.\n\nReported-by: Son Luong Ngoc <sluongng@gmail.com>\nSigned-off-by: Jeff King <peff@peff.net>\n---\n t/t0000-basic.sh | 1 +\n 1 file changed, 1 insertion(+)\n\ndiff --git a/t/t0000-basic.sh b/t/t0000-basic.sh\nindex b859721620..f58f3deaa8 100755\n--- a/t/t0000-basic.sh\n+++ b/t/t0000-basic.sh\n@@ -98,6 +98,7 @@ _run_sub_test_lib_test_common () {\n \t\texport TEST_DIRECTORY &&\n \t\tTEST_OUTPUT_DIRECTORY=$(pwd) &&\n \t\texport TEST_OUTPUT_DIRECTORY &&\n+\t\tsane_unset GIT_TEST_FAIL_PREREQS &&\n \t\tif test -z \"$neg\"\n \t\tthen\n \t\t\t./\"$name.sh\" \"$@\" >out 2>err\n-- \n2.26.2.827.g3c1233342b\n\n"},{"id":"396786","messageId":"nycvar.QRO.7.76.6.2005012256140.18039@tvgsbejvaqbjf.bet","threadId":"53338","inReplyTo":"20200428081421.GA2381876@coredump.intra.peff.net","subject":"Re: [PATCH] t0000: disable GIT_TEST_FAIL_PREREQS in sub-tests","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2020-05-01T20:56:44Z","receivedAt":"2020-05-01T20:56:59Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Tue, 28 Apr 2020, Jeff King wrote:\n\n> On Tue, Apr 28, 2020 at 08:52:34AM +0200, Son Luong Ngoc wrote:\n>\n> > Running t0000 with GIT_TEST_FAIL_PREREQS=true is failing.\n> >\n> > > GIT_TEST_FAIL_PREREQS=true ./t0000-basic.sh\n> > t/./t0000-basic.sh:836: error: not ok 45 - lazy prereqs do not turn off tracing\n> > #\n> > #               run_sub_test_lib_test lazy-prereq-and-tracing\n> >  'lazy prereqs and -x' -v -x <<-\\EOF &&\n> > #               test_lazy_prereq LAZY true\n> > #\n> > #               test_expect_success lazy 'test_have_prereq LAZY && echo trace'\n> > #\n> > #               test_done\n> > #               EOF\n> > #\n> > #               grep 'echo trace' lazy-prereq-and-tracing/err\n>\n> I think the patch below is the right fix.\n>\n> -- >8 --\n> Subject: [PATCH] t0000: disable GIT_TEST_FAIL_PREREQS in sub-tests\n>\n> The test added by 477dcaddb6 (tests: do not let lazy prereqs inside\n> `test_expect_*` turn off tracing, 2020-03-26) runs a sub-test script\n> that traces a test with a lazy prereq, like:\n>\n>   test_have_prereq LAZY && echo trace\n>\n> That won't work if GIT_TEST_FAIL_PREREQS is set in the environment,\n> because our have_prereq will report failure, and we won't run the echo\n> at all.\n>\n> We could work around this by avoiding the &&-chain, but we can\n> fix this and any future tests at once by unsetting that variable for our\n> sub-tests. These are meant to be controlled environments where we test\n> the test-suite itself; the outer test snippet should be in charge of the\n> sub-test environment, not whatever mode the user happens to be running\n> in.\n\nThanks for fixing a bug I introduced! The fix looks good to me.\n\nThank you,\nDscho\n\n>\n> Reported-by: Son Luong Ngoc <sluongng@gmail.com>\n> Signed-off-by: Jeff King <peff@peff.net>\n> ---\n>  t/t0000-basic.sh | 1 +\n>  1 file changed, 1 insertion(+)\n>\n> diff --git a/t/t0000-basic.sh b/t/t0000-basic.sh\n> index b859721620..f58f3deaa8 100755\n> --- a/t/t0000-basic.sh\n> +++ b/t/t0000-basic.sh\n> @@ -98,6 +98,7 @@ _run_sub_test_lib_test_common () {\n>  \t\texport TEST_DIRECTORY &&\n>  \t\tTEST_OUTPUT_DIRECTORY=$(pwd) &&\n>  \t\texport TEST_OUTPUT_DIRECTORY &&\n> +\t\tsane_unset GIT_TEST_FAIL_PREREQS &&\n>  \t\tif test -z \"$neg\"\n>  \t\tthen\n>  \t\t\t./\"$name.sh\" \"$@\" >out 2>err\n> --\n> 2.26.2.827.g3c1233342b\n>\n>\n"}]}