{"thread":{"id":"61482","subject":"[PATCH] t0017: clarify dubious test set-up","startedAt":"2024-05-15T19:33:52Z","lastAt":"2024-05-15T19:33:52Z","messageCount":1,"participants":["Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"494835","messageId":"xmqqcypmx44l.fsf@gitster.g","threadId":"61482","inReplyTo":null,"subject":"[PATCH] t0017: clarify dubious test set-up","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2024-05-15T19:32:42Z","receivedAt":"2024-05-15T19:33:52Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"1ff750b1 (tests: make GIT_TEST_GETTEXT_POISON a boolean, 2019-06-21)\nadded this test, in which \"test-tool -C\" is fed a name of a\ndirectory that does not exist, and expects that it dies because of a\nfailure to read the configuration file(s), because the configuration\nsetting is screwed up to contain mutual inclusion loop, before it\nnotices that the directory to chdir into does not exist and dies.\n\nIt is of dubious value to etch the current order of events, i.e.,\nthe configuration needs to be read that early (for initializing\ntrace2 subsystem) before we even notice the lack of the directory\nand have a chance to fail, into stone.  Indeed, if you completely\ncompile out trace2 subsystem so that it does not even attempt to\nread the configuration that early, we would die with a different\nerror message (i.e. \"unable to chdir to 'cycle'\") and this test will\nfail.\n\nAt least give a bogus argument to \"test-tool -C\" a name that is\nclearly bogus to make sure we can more easily see what is going on\nwith plenty of comments.  \n\nWe may want to remove this test altogether, instead, though.\n\nSigned-off-by: Junio C Hamano <gitster@pobox.com>\n---\n t/t0017-env-helper.sh | 9 ++++++++-\n 1 file changed, 8 insertions(+), 1 deletion(-)\n\ndiff --git a/t/t0017-env-helper.sh b/t/t0017-env-helper.sh\nindex fc14ba091c..f3a16859cc 100755\n--- a/t/t0017-env-helper.sh\n+++ b/t/t0017-env-helper.sh\n@@ -91,9 +91,16 @@ test_expect_success 'test-tool env-helper reads config thanks to trace2' '\n \t\tgit config -l 2>err &&\n \tgrep \"exceeded maximum include depth\" err &&\n \n+\t# This validates that the assumption that we attempt to\n+\t# read the configuration and fail very early in the start-up\n+\t# sequence (due to trace2 subsystem), even before we notice\n+\t# that the directory named with \"test-tool -C\" does not exist\n+\t# and die.  It is a dubious thing to test, though.\n \ttest_must_fail \\\n \t\tenv HOME=\"$(pwd)/home\" GIT_TEST_ENV_HELPER=true \\\n-\t\ttest-tool -C cycle env-helper --type=bool --default=0 --exit-code GIT_TEST_ENV_HELPER 2>err &&\n+\t\ttest-tool -C no-such-directory \\\n+\t\tenv-helper --type=bool --default=0 \\\n+\t\t--exit-code GIT_TEST_ENV_HELPER 2>err &&\n \tgrep \"exceeded maximum include depth\" err\n '\n \n-- \n2.45.1-190-g19fe900cfc\n\n"}]}