{"thread":{"id":"58010","subject":"[PATCH 0/1] For v2.37.0: fix tests breaking with NO_CURL=Y","startedAt":"2022-06-15T10:36:51Z","lastAt":"2022-06-15T21:08:57Z","messageCount":5,"participants":["Ævar Arnfjörð Bjarmason","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":1},"messages":[{"id":"457257","messageId":"cover-0.1-00000000000-20220615T103609Z-avarab@gmail.com","threadId":"58010","inReplyTo":null,"subject":"[PATCH 0/1] For v2.37.0: fix tests breaking with NO_CURL=Y","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2022-06-15T10:36:31Z","receivedAt":"2022-06-15T10:36:51Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"The fetch.credentialsInUrl inadvertently broke with NO_CURL=Y builds,\nwhich I'm e.g. spotting in my GCC farm testing. This fixes it.\n\nÆvar Arnfjörð Bjarmason (1):\n  tests: add LIBCURL prerequisite to tests needing libcurl\n\n t/lib-httpd.sh        | 2 +-\n t/t5516-fetch-push.sh | 4 ++--\n t/t5601-clone.sh      | 4 ++--\n t/test-lib.sh         | 1 +\n 4 files changed, 6 insertions(+), 5 deletions(-)\n\n-- \n2.36.1.1239.gfba91521d90\n\n"},{"id":"457258","messageId":"patch-1.1-353c384d2b1-20220615T103609Z-avarab@gmail.com","threadId":"58010","inReplyTo":"cover-0.1-00000000000-20220615T103609Z-avarab@gmail.com","subject":"[PATCH 1/1] tests: add LIBCURL prerequisite to tests needing libcurl","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2022-06-15T10:36:32Z","receivedAt":"2022-06-15T10:36:55Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Add and use a LIBCURL prerequisite for tests added in\n6dcbdc0d661 (remote: create fetch.credentialsInUrl config,\n2022-06-06).\n\nThese tests would get as far as emitting a couple of the warnings we\nwere testing for, but would then die as we had no \"git-remote-https\"\nprogram compiled.\n\nIt would be more consistent with other prerequisites (e.g. PERL for\nNO_PERL) to name this \"CURL\", but since e9184b0789a (t5561: skip tests\nif curl is not available, 2018-04-03) we've had that prerequisite\ndefined for checking of we have the curl(1) program.\n\nThe existing \"CURL\" prerequisite is only used in one place, and we\nshould probably name it \"CURL_PROGRAM\", then rename \"LIBCURL\" to\n\"CURL\" as a follow-up, but for now (pre-v2.37.0) let's aim for the\nmost minimal fix possible.\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n t/lib-httpd.sh        | 2 +-\n t/t5516-fetch-push.sh | 4 ++--\n t/t5601-clone.sh      | 4 ++--\n t/test-lib.sh         | 1 +\n 4 files changed, 6 insertions(+), 5 deletions(-)\n\ndiff --git a/t/lib-httpd.sh b/t/lib-httpd.sh\nindex 782891908d7..1f6b9b08d1d 100644\n--- a/t/lib-httpd.sh\n+++ b/t/lib-httpd.sh\n@@ -29,7 +29,7 @@\n # Copyright (c) 2008 Clemens Buchacher <drizzd@aon.at>\n #\n \n-if test -n \"$NO_CURL\"\n+if ! test_have_prereq LIBCURL\n then\n \tskip_all='skipping test, git built without http support'\n \ttest_done\ndiff --git a/t/t5516-fetch-push.sh b/t/t5516-fetch-push.sh\nindex dedca106a7a..c1220b2ed35 100755\n--- a/t/t5516-fetch-push.sh\n+++ b/t/t5516-fetch-push.sh\n@@ -1834,7 +1834,7 @@ test_expect_success 'refuse to push a hidden ref, and make sure do not pollute t\n \ttest_dir_is_empty testrepo/.git/objects/pack\n '\n \n-test_expect_success 'fetch warns or fails when using username:password' '\n+test_expect_success LIBCURL 'fetch warns or fails when using username:password' '\n \tmessage=\"URL '\\''https://username:<redacted>@localhost/'\\'' uses plaintext credentials\" &&\n \ttest_must_fail git -c fetch.credentialsInUrl=allow fetch https://username:password@localhost 2>err &&\n \t! grep \"$message\" err &&\n@@ -1853,7 +1853,7 @@ test_expect_success 'fetch warns or fails when using username:password' '\n '\n \n \n-test_expect_success 'push warns or fails when using username:password' '\n+test_expect_success LIBCURL 'push warns or fails when using username:password' '\n \tmessage=\"URL '\\''https://username:<redacted>@localhost/'\\'' uses plaintext credentials\" &&\n \ttest_must_fail git -c fetch.credentialsInUrl=allow push https://username:password@localhost 2>err &&\n \t! grep \"$message\" err &&\ndiff --git a/t/t5601-clone.sh b/t/t5601-clone.sh\nindex d2f046b4b92..eeed233362d 100755\n--- a/t/t5601-clone.sh\n+++ b/t/t5601-clone.sh\n@@ -71,7 +71,7 @@ test_expect_success 'clone respects GIT_WORK_TREE' '\n \n '\n \n-test_expect_success 'clone warns or fails when using username:password' '\n+test_expect_success LIBCURL 'clone warns or fails when using username:password' '\n \tmessage=\"URL '\\''https://username:<redacted>@localhost/'\\'' uses plaintext credentials\" &&\n \ttest_must_fail git -c fetch.credentialsInUrl=allow clone https://username:password@localhost attempt1 2>err &&\n \t! grep \"$message\" err &&\n@@ -89,7 +89,7 @@ test_expect_success 'clone warns or fails when using username:password' '\n \ttest_line_count = 1 warnings\n '\n \n-test_expect_success 'clone does not detect username:password when it is https://username@domain:port/' '\n+test_expect_success LIBCURL 'clone does not detect username:password when it is https://username@domain:port/' '\n \ttest_must_fail git -c fetch.credentialsInUrl=warn clone https://username@localhost:8080 attempt3 2>err &&\n \t! grep \"uses plaintext credentials\" err\n '\ndiff --git a/t/test-lib.sh b/t/test-lib.sh\nindex 736c6447ecf..02bc88c72b4 100644\n--- a/t/test-lib.sh\n+++ b/t/test-lib.sh\n@@ -1572,6 +1572,7 @@ esac\n test_set_prereq REFFILES\n \n ( COLUMNS=1 && test $COLUMNS = 1 ) && test_set_prereq COLUMNS_CAN_BE_1\n+test -z \"$NO_CURL\" && test_set_prereq LIBCURL\n test -z \"$NO_PERL\" && test_set_prereq PERL\n test -z \"$NO_PTHREADS\" && test_set_prereq PTHREADS\n test -z \"$NO_PYTHON\" && test_set_prereq PYTHON\n-- \n2.36.1.1239.gfba91521d90\n\n"},{"id":"457302","messageId":"xmqq35g5232b.fsf@gitster.g","threadId":"58010","inReplyTo":"patch-1.1-353c384d2b1-20220615T103609Z-avarab@gmail.com","subject":"Re: [PATCH 1/1] tests: add LIBCURL prerequisite to tests needing libcurl","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2022-06-15T18:29:16Z","receivedAt":"2022-06-15T18:29:25Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Ævar Arnfjörð Bjarmason  <avarab@gmail.com> writes:\n\n> The existing \"CURL\" prerequisite is only used in one place, and we\n> should probably name it \"CURL_PROGRAM\",\n\nTrue.  It probably wants to become a lazy prerequisite defined only\nin that program.\n\n> then rename \"LIBCURL\" to\n> \"CURL\" as a follow-up, but for now (pre-v2.37.0) let's aim for the\n> most minimal fix possible.\n\nOK.\n\n> Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n> ---\n>  t/lib-httpd.sh        | 2 +-\n>  t/t5516-fetch-push.sh | 4 ++--\n>  t/t5601-clone.sh      | 4 ++--\n>  t/test-lib.sh         | 1 +\n>  4 files changed, 6 insertions(+), 5 deletions(-)\n>\n> diff --git a/t/lib-httpd.sh b/t/lib-httpd.sh\n> index 782891908d7..1f6b9b08d1d 100644\n> --- a/t/lib-httpd.sh\n> +++ b/t/lib-httpd.sh\n> @@ -29,7 +29,7 @@\n>  # Copyright (c) 2008 Clemens Buchacher <drizzd@aon.at>\n>  #\n>  \n> -if test -n \"$NO_CURL\"\n> +if ! test_have_prereq LIBCURL\n>  then\n>  \tskip_all='skipping test, git built without http support'\n>  \ttest_done\n\nThis is not strictly needed in \"the most minimal fix possible\", is\nit?  Just checking.\n\n> diff --git a/t/t5516-fetch-push.sh b/t/t5516-fetch-push.sh\n> index dedca106a7a..c1220b2ed35 100755\n> --- a/t/t5516-fetch-push.sh\n> +++ b/t/t5516-fetch-push.sh\n> @@ -1834,7 +1834,7 @@ test_expect_success 'refuse to push a hidden ref, and make sure do not pollute t\n>  \ttest_dir_is_empty testrepo/.git/objects/pack\n>  '\n>  \n> -test_expect_success 'fetch warns or fails when using username:password' '\n> +test_expect_success LIBCURL 'fetch warns or fails when using username:password' '\n\nThis _is_ needed.\n\n> -test_expect_success 'push warns or fails when using username:password' '\n> +test_expect_success LIBCURL 'push warns or fails when using username:password' '\n\nSo is this.\n\n> -test_expect_success 'clone warns or fails when using username:password' '\n> +test_expect_success LIBCURL 'clone warns or fails when using username:password' '\n\nAnd this too.\n\n> -test_expect_success 'clone does not detect username:password when it is https://username@domain:port/' '\n> +test_expect_success LIBCURL 'clone does not detect username:password when it is https://username@domain:port/' '\n\nAnd this too.\n\n> diff --git a/t/test-lib.sh b/t/test-lib.sh\n> index 736c6447ecf..02bc88c72b4 100644\n> --- a/t/test-lib.sh\n> +++ b/t/test-lib.sh\n> @@ -1572,6 +1572,7 @@ esac\n>  test_set_prereq REFFILES\n>  \n>  ( COLUMNS=1 && test $COLUMNS = 1 ) && test_set_prereq COLUMNS_CAN_BE_1\n> +test -z \"$NO_CURL\" && test_set_prereq LIBCURL\n\nAnd this, of course.\n\n>  test -z \"$NO_PERL\" && test_set_prereq PERL\n>  test -z \"$NO_PTHREADS\" && test_set_prereq PTHREADS\n>  test -z \"$NO_PYTHON\" && test_set_prereq PYTHON\n"},{"id":"457314","messageId":"220615.861qvpy8jq.gmgdl@evledraar.gmail.com","threadId":"58010","inReplyTo":"xmqq35g5232b.fsf@gitster.g","subject":"Re: [PATCH 1/1] tests: add LIBCURL prerequisite to tests needing libcurl","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2022-06-15T20:28:29Z","receivedAt":"2022-06-15T20:29:52Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"\nOn Wed, Jun 15 2022, Junio C Hamano wrote:\n\n> Ævar Arnfjörð Bjarmason  <avarab@gmail.com> writes:\n>\n>> The existing \"CURL\" prerequisite is only used in one place, and we\n>> should probably name it \"CURL_PROGRAM\",\n>\n> True.  It probably wants to become a lazy prerequisite defined only\n> in that program.\n\nYes, I have that fix, but left it out for the \"for v2.37.0\" ...\n\n>> then rename \"LIBCURL\" to\n>> \"CURL\" as a follow-up, but for now (pre-v2.37.0) let's aim for the\n>> most minimal fix possible.\n>\n> OK.\n>\n>> Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n>> ---\n>>  t/lib-httpd.sh        | 2 +-\n>>  t/t5516-fetch-push.sh | 4 ++--\n>>  t/t5601-clone.sh      | 4 ++--\n>>  t/test-lib.sh         | 1 +\n>>  4 files changed, 6 insertions(+), 5 deletions(-)\n>>\n>> diff --git a/t/lib-httpd.sh b/t/lib-httpd.sh\n>> index 782891908d7..1f6b9b08d1d 100644\n>> --- a/t/lib-httpd.sh\n>> +++ b/t/lib-httpd.sh\n>> @@ -29,7 +29,7 @@\n>>  # Copyright (c) 2008 Clemens Buchacher <drizzd@aon.at>\n>>  #\n>>  \n>> -if test -n \"$NO_CURL\"\n>> +if ! test_have_prereq LIBCURL\n>>  then\n>>  \tskip_all='skipping test, git built without http support'\n>>  \ttest_done\n>\n> This is not strictly needed in \"the most minimal fix possible\", is\n> it?  Just checking.\n\nI figured if I was adding a $NO_CURL prereq I might as well change the\nonly existing use of $NO_CURL to use it, which also assures the reader\nthat our test suite is getting this from somewhere already.\n\nBut I'll drop this in a re-roll.\n"},{"id":"457318","messageId":"xmqq5yl1zlb1.fsf@gitster.g","threadId":"58010","inReplyTo":"220615.861qvpy8jq.gmgdl@evledraar.gmail.com","subject":"Re: [PATCH 1/1] tests: add LIBCURL prerequisite to tests needing libcurl","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2022-06-15T21:08:50Z","receivedAt":"2022-06-15T21:08:57Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Ævar Arnfjörð Bjarmason <avarab@gmail.com> writes:\n\n>>> -if test -n \"$NO_CURL\"\n>>> +if ! test_have_prereq LIBCURL\n>>>  then\n>>>  \tskip_all='skipping test, git built without http support'\n>>>  \ttest_done\n>>\n>> This is not strictly needed in \"the most minimal fix possible\", is\n>> it?  Just checking.\n>\n> I figured if I was adding a $NO_CURL prereq I might as well change the\n> only existing use of $NO_CURL to use it, which also assures the reader\n> that our test suite is getting this from somewhere already.\n>\n> But I'll drop this in a re-roll.\n\nNo need.  It already is at the tip of 'master' applied directly.\n"}]}