From patchwork Thu Aug 1 15:53:07 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?SZEDER_G=C3=A1bor?= X-Patchwork-Id: 11070969 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id AD9DB1395 for ; Thu, 1 Aug 2019 15:53:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9FBB62842D for ; Thu, 1 Aug 2019 15:53:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8F0AA285E8; Thu, 1 Aug 2019 15:53:31 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9CA7428474 for ; Thu, 1 Aug 2019 15:53:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732004AbfHAPx2 (ORCPT ); Thu, 1 Aug 2019 11:53:28 -0400 Received: from mail-wm1-f65.google.com ([209.85.128.65]:37276 "EHLO mail-wm1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730541AbfHAPx0 (ORCPT ); Thu, 1 Aug 2019 11:53:26 -0400 Received: by mail-wm1-f65.google.com with SMTP id f17so63638860wme.2 for ; Thu, 01 Aug 2019 08:53:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=6XZWqNe23BNdaGrEkB80ojuU5o+2UTNTM6wOSPJMGVc=; b=QF3LNSz74TtHtJwbvg0F3nQar2l2F4AB2H+TUe1tn+FrEZUM8N7F4RJF91YdxSitK2 M+RiF8+0qS/bpd4Jb+5J0PGiUJYSlEh/qPVfNF30evN92TgdqdSm9dH3mPS/OgHQMxil Zdi7AXcx0b6GBREcL1TVdWxDj/5EdcLl2rQzQZIATAxpvnlvmHPTE/wNDo8WqmfNo6WT Wr+VNpmMndeV4+GOAKQIVBS7k0QDvqN52qaIFw4yCjIApawgdvjIUMEeqqmfACYvIz6w xazbPfRZbA0ZBegXVz+Om73C432lxclQbPRxna7guxjS14S5r/BPfX6RFY9CkbaY3zFB /eEA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=6XZWqNe23BNdaGrEkB80ojuU5o+2UTNTM6wOSPJMGVc=; b=DmgFOgMFYoxnsVlQKb92ZBTj9n9ira9eRqX+yU3Etj1TBjIi2zi185TSzweCBOnIxO JBOxX1I1k/091M941fPu37d7BOvT4pjxn2zmGFV36EuwTiiVEX0/WkNl71R+ovJetwYy JvNTzKAlEh03d97crfH3lMrnf2UQGRnP05AgMj2pv3UwA41+C1vmlbuJ0Yk3yX44Y5MG LdQ2oGoLVQQ41tdXjMjd95A9NN087S4/zB7xatZ+4hANG78AKw606Dkiut/MIG4wr+bW HbJzEqAHJW/QTwATrmthDzvOPUSIjzaCRNkCTbDf6vGKrBZIpvHCSNgtr1yKVvM/8Dyt d6Ow== X-Gm-Message-State: APjAAAWQ7P8dyidm5Ph7qVA772xy97bcs+391J/BugH0aCBsox7PQHVz tGNiXe99iQ41j1zTT5cvioY= X-Google-Smtp-Source: APXvYqyIrzUUkIrlfI6ewEHkQB7JqxwGdDmMg/m4ltR68ia7XxT5nAwaOkh0Wcz3bNTgtyR1YwtbrA== X-Received: by 2002:a1c:f409:: with SMTP id z9mr46839642wma.176.1564674804775; Thu, 01 Aug 2019 08:53:24 -0700 (PDT) Received: from localhost.localdomain (x4dbd0ed1.dyn.telefonica.de. [77.189.14.209]) by smtp.gmail.com with ESMTPSA id g17sm55434473wrm.7.2019.08.01.08.53.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 01 Aug 2019 08:53:24 -0700 (PDT) From: =?utf-8?q?SZEDER_G=C3=A1bor?= To: Junio C Hamano Cc: Derrick Stolee , Brandon Williams , git@vger.kernel.org, =?utf-8?q?SZEDER_G=C3=A1bor?= Subject: [PATCH 1/3] t5510-fetch: run non-httpd-specific test before sourcing 'lib-httpd.sh' Date: Thu, 1 Aug 2019 17:53:07 +0200 Message-Id: <20190801155309.15276-2-szeder.dev@gmail.com> X-Mailer: git-send-email 2.22.0.926.g602b9a0287 In-Reply-To: <20190801155309.15276-1-szeder.dev@gmail.com> References: <20190730214000.GT20404@szeder.dev> <20190801155309.15276-1-szeder.dev@gmail.com> MIME-Version: 1.0 Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 't5510-fetch.sh' sources 'lib-httpd.sh' near the end to run a httpd-specific test, but 'lib-httpd.sh' skips all the rest of the test script if the dependencies for running httpd tests are not fulfilled. Alas, recently cdbd70c437 (fetch: add --[no-]show-forced-updates argument, 2019-06-18) appended a non-httpd-specific test at the end, and this test is then skipped as well when httpd tests can't be run. Move this new test earlier in the test script, before 'lib-httpd.sh' is sourced, so it will be run even when httpd tests aren't. Also add a comment at the end of this test script to warn against adding non-httpd-specific tests at the end, in the hope that it will help prevent similar issues in the future. Signed-off-by: SZEDER Gábor --- t/t5510-fetch.sh | 47 +++++++++++++++++++++++++---------------------- 1 file changed, 25 insertions(+), 22 deletions(-) diff --git a/t/t5510-fetch.sh b/t/t5510-fetch.sh index f2481de577..34b486f1a4 100755 --- a/t/t5510-fetch.sh +++ b/t/t5510-fetch.sh @@ -902,6 +902,29 @@ test_expect_success C_LOCALE_OUTPUT 'fetch compact output' ' test_cmp expect actual ' +test_expect_success '--no-show-forced-updates' ' + mkdir forced-updates && + ( + cd forced-updates && + git init && + test_commit 1 && + test_commit 2 + ) && + git clone forced-updates forced-update-clone && + git clone forced-updates no-forced-update-clone && + git -C forced-updates reset --hard HEAD~1 && + ( + cd forced-update-clone && + git fetch --show-forced-updates origin 2>output && + test_i18ngrep "(forced update)" output + ) && + ( + cd no-forced-update-clone && + git fetch --no-show-forced-updates origin 2>output && + test_i18ngrep ! "(forced update)" output + ) +' + setup_negotiation_tip () { SERVER="$1" URL="$2" @@ -978,27 +1001,7 @@ test_expect_success '--negotiation-tip limits "have" lines sent with HTTP protoc check_negotiation_tip ' -test_expect_success '--no-show-forced-updates' ' - mkdir forced-updates && - ( - cd forced-updates && - git init && - test_commit 1 && - test_commit 2 - ) && - git clone forced-updates forced-update-clone && - git clone forced-updates no-forced-update-clone && - git -C forced-updates reset --hard HEAD~1 && - ( - cd forced-update-clone && - git fetch --show-forced-updates origin 2>output && - test_i18ngrep "(forced update)" output - ) && - ( - cd no-forced-update-clone && - git fetch --no-show-forced-updates origin 2>output && - test_i18ngrep ! "(forced update)" output - ) -' +# DO NOT add non-httpd-specific tests here, because the last part of this +# test script is only executed when httpd is available and enabled. test_done From patchwork Thu Aug 1 15:53:08 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?SZEDER_G=C3=A1bor?= X-Patchwork-Id: 11070971 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 87EE6112C for ; Thu, 1 Aug 2019 15:53:32 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7853728474 for ; Thu, 1 Aug 2019 15:53:32 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 68C8E28517; Thu, 1 Aug 2019 15:53:32 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9833E2844E for ; Thu, 1 Aug 2019 15:53:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732085AbfHAPxb (ORCPT ); Thu, 1 Aug 2019 11:53:31 -0400 Received: from mail-wm1-f67.google.com ([209.85.128.67]:34118 "EHLO mail-wm1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729162AbfHAPxa (ORCPT ); Thu, 1 Aug 2019 11:53:30 -0400 Received: by mail-wm1-f67.google.com with SMTP id w9so3977535wmd.1 for ; Thu, 01 Aug 2019 08:53:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=FZNYpZtAIt98uJsXCqizlgB4MKuOnYXl8BmhUJ3N3Y4=; b=pUzH/Z8gw6B3BxRsHl283di370tE5oXnw9tFj6Q3oDiMLjf4SfKf4QwQ4ZYRnJYAku v6RxcJzrn08cMtP5M2p+uCQ9lI30bqxtgvOEU9qSiH4GgpMXDl0NgOFfTHKawlWsBxpD E7/vKt/mFu2r4DeYEKdFfTjxzwOx63Cr3Xc5VFFSxHXltD4Lom/BYWgLwq/Mj2dU8xrG jt4HFA9wWdXeaAFowe1LZCCNsrTi72rTzElO4JdC6WU5+qK8oooSDwP19W51woF4eaeA FoVzQ4noptV20JIJGrCwh/VaHn4DJoOvTADtgJ+4f2M2Y2FCT/aW8l0OnZ3sUxbF41cd 7mow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=FZNYpZtAIt98uJsXCqizlgB4MKuOnYXl8BmhUJ3N3Y4=; b=HTWZNsPpnZa+SlEW+Wdb7ogxlmYkzBrsqWyPrStwNzKAXIU6bPhrgqRKWdk7SQ3NIv gLOD8R5wVHWUuTvySxLsrxWReC5lgTF9dQJb2wSbLCNUaDHHmYGEHk5PS80yu5Hs+8/o wfxjucbVGjjCahrW+QXjCpH+liJ3vegKxxhMf3PdFhkG6IjUfN2sDeu7gRIeX3N/d3yF 7dHGQlalFF19C6w5+Cwy7nObKWRJYS/Kc60BK4uGFZBdbtregPaPf7Rt1vZ1ayyWScQj 3X7db4PPNbF9G9Mw+HyZvsVeQ4w19ZrI+FRybeqoXmFtlWk4I/KHhnZqMg+epZf8SCRk AwGw== X-Gm-Message-State: APjAAAWHL9ayCs9Ilev3ZpB567KUOe5+uoer+Uck6JNzO9uZZfC9Wx6e WLoKrBO/HsIfXl0Qjx6V0ls= X-Google-Smtp-Source: APXvYqyFoTp4GTHwwTODFW8m7jfT5hkBhvDB2HJjQ7hSv2A8UseCwnCKtbsXXVLLbyj1UO1b5qWHcQ== X-Received: by 2002:a1c:2302:: with SMTP id j2mr113269260wmj.174.1564674805861; Thu, 01 Aug 2019 08:53:25 -0700 (PDT) Received: from localhost.localdomain (x4dbd0ed1.dyn.telefonica.de. [77.189.14.209]) by smtp.gmail.com with ESMTPSA id g17sm55434473wrm.7.2019.08.01.08.53.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 01 Aug 2019 08:53:25 -0700 (PDT) From: =?utf-8?q?SZEDER_G=C3=A1bor?= To: Junio C Hamano Cc: Derrick Stolee , Brandon Williams , git@vger.kernel.org, =?utf-8?q?SZEDER_G=C3=A1bor?= Subject: [PATCH 2/3] t5703: run all non-httpd-specific tests before sourcing 'lib-httpd.sh' Date: Thu, 1 Aug 2019 17:53:08 +0200 Message-Id: <20190801155309.15276-3-szeder.dev@gmail.com> X-Mailer: git-send-email 2.22.0.926.g602b9a0287 In-Reply-To: <20190801155309.15276-1-szeder.dev@gmail.com> References: <20190730214000.GT20404@szeder.dev> <20190801155309.15276-1-szeder.dev@gmail.com> MIME-Version: 1.0 Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 't5703-upload-pack-ref-in-want.sh' sources 'lib-httpd.sh' near the end to run a couple of httpd-specific tests, but 'lib-httpd.sh' skips all the rest of the test script if the dependencies for running httpd tests are not fulfilled. However, the last six tests in 't5703' are not httpd-specific, but they are skipped as well when httpd tests can't be run. Move these six tests earlier in the test script, before 'lib-httpd.sh' is sourced, so they will be run even when httpd tests aren't. Note that this is not merely a pure code movement, because the setup test case for the httpd tests needed an additional 'rm -rf "$LOCAL_PRISTINE"' to clean up a directory left behind by the moved non-httpd-specific tests. Also add a comment at the end of this test script to warn against adding non-httpd-specific tests at the end, in the hope that it will help prevent similar issues in the future. Signed-off-by: SZEDER Gábor --- t/t5703-upload-pack-ref-in-want.sh | 204 +++++++++++++++-------------- 1 file changed, 104 insertions(+), 100 deletions(-) diff --git a/t/t5703-upload-pack-ref-in-want.sh b/t/t5703-upload-pack-ref-in-want.sh index de4b6106ef..3a2c143c6d 100755 --- a/t/t5703-upload-pack-ref-in-want.sh +++ b/t/t5703-upload-pack-ref-in-want.sh @@ -157,106 +157,6 @@ test_expect_success 'want-ref with ref we already have commit for' ' check_output ' -. "$TEST_DIRECTORY"/lib-httpd.sh -start_httpd - -REPO="$HTTPD_DOCUMENT_ROOT_PATH/repo" -LOCAL_PRISTINE="$(pwd)/local_pristine" - -test_expect_success 'setup repos for change-while-negotiating test' ' - ( - git init "$REPO" && - cd "$REPO" && - >.git/git-daemon-export-ok && - test_commit m1 && - git tag -d m1 && - - # Local repo with many commits (so that negotiation will take - # more than 1 request/response pair) - git clone "http://127.0.0.1:$LIB_HTTPD_PORT/smart/repo" "$LOCAL_PRISTINE" && - cd "$LOCAL_PRISTINE" && - git checkout -b side && - test_commit_bulk --id=s 33 && - - # Add novel commits to upstream - git checkout master && - cd "$REPO" && - test_commit m2 && - test_commit m3 && - git tag -d m2 m3 - ) && - git -C "$LOCAL_PRISTINE" remote set-url origin "http://127.0.0.1:$LIB_HTTPD_PORT/one_time_sed/repo" && - git -C "$LOCAL_PRISTINE" config protocol.version 2 -' - -inconsistency () { - # Simulate that the server initially reports $2 as the ref - # corresponding to $1, and after that, $1 as the ref corresponding to - # $1. This corresponds to the real-life situation where the server's - # repository appears to change during negotiation, for example, when - # different servers in a load-balancing arrangement serve (stateless) - # RPCs during a single negotiation. - printf "s/%s/%s/" \ - $(git -C "$REPO" rev-parse $1 | tr -d "\n") \ - $(git -C "$REPO" rev-parse $2 | tr -d "\n") \ - >"$HTTPD_ROOT_PATH/one-time-sed" -} - -test_expect_success 'server is initially ahead - no ref in want' ' - git -C "$REPO" config uploadpack.allowRefInWant false && - rm -rf local && - cp -r "$LOCAL_PRISTINE" local && - inconsistency master 1234567890123456789012345678901234567890 && - test_must_fail git -C local fetch 2>err && - test_i18ngrep "fatal: remote error: upload-pack: not our ref" err -' - -test_expect_success 'server is initially ahead - ref in want' ' - git -C "$REPO" config uploadpack.allowRefInWant true && - rm -rf local && - cp -r "$LOCAL_PRISTINE" local && - inconsistency master 1234567890123456789012345678901234567890 && - git -C local fetch && - - git -C "$REPO" rev-parse --verify master >expected && - git -C local rev-parse --verify refs/remotes/origin/master >actual && - test_cmp expected actual -' - -test_expect_success 'server is initially behind - no ref in want' ' - git -C "$REPO" config uploadpack.allowRefInWant false && - rm -rf local && - cp -r "$LOCAL_PRISTINE" local && - inconsistency master "master^" && - git -C local fetch && - - git -C "$REPO" rev-parse --verify "master^" >expected && - git -C local rev-parse --verify refs/remotes/origin/master >actual && - test_cmp expected actual -' - -test_expect_success 'server is initially behind - ref in want' ' - git -C "$REPO" config uploadpack.allowRefInWant true && - rm -rf local && - cp -r "$LOCAL_PRISTINE" local && - inconsistency master "master^" && - git -C local fetch && - - git -C "$REPO" rev-parse --verify "master" >expected && - git -C local rev-parse --verify refs/remotes/origin/master >actual && - test_cmp expected actual -' - -test_expect_success 'server loses a ref - ref in want' ' - git -C "$REPO" config uploadpack.allowRefInWant true && - rm -rf local && - cp -r "$LOCAL_PRISTINE" local && - echo "s/master/raster/" >"$HTTPD_ROOT_PATH/one-time-sed" && - test_must_fail git -C local fetch 2>err && - - test_i18ngrep "fatal: remote error: unknown ref refs/heads/raster" err -' - REPO="$(pwd)/repo" LOCAL_PRISTINE="$(pwd)/local_pristine" @@ -372,4 +272,108 @@ test_expect_success 'fetching with wildcard that matches multiple refs' ' grep "want-ref refs/heads/o/bar" log ' +. "$TEST_DIRECTORY"/lib-httpd.sh +start_httpd + +REPO="$HTTPD_DOCUMENT_ROOT_PATH/repo" +LOCAL_PRISTINE="$(pwd)/local_pristine" + +test_expect_success 'setup repos for change-while-negotiating test' ' + ( + git init "$REPO" && + cd "$REPO" && + >.git/git-daemon-export-ok && + test_commit m1 && + git tag -d m1 && + + # Local repo with many commits (so that negotiation will take + # more than 1 request/response pair) + rm -rf "$LOCAL_PRISTINE" && + git clone "http://127.0.0.1:$LIB_HTTPD_PORT/smart/repo" "$LOCAL_PRISTINE" && + cd "$LOCAL_PRISTINE" && + git checkout -b side && + test_commit_bulk --id=s 33 && + + # Add novel commits to upstream + git checkout master && + cd "$REPO" && + test_commit m2 && + test_commit m3 && + git tag -d m2 m3 + ) && + git -C "$LOCAL_PRISTINE" remote set-url origin "http://127.0.0.1:$LIB_HTTPD_PORT/one_time_sed/repo" && + git -C "$LOCAL_PRISTINE" config protocol.version 2 +' + +inconsistency () { + # Simulate that the server initially reports $2 as the ref + # corresponding to $1, and after that, $1 as the ref corresponding to + # $1. This corresponds to the real-life situation where the server's + # repository appears to change during negotiation, for example, when + # different servers in a load-balancing arrangement serve (stateless) + # RPCs during a single negotiation. + printf "s/%s/%s/" \ + $(git -C "$REPO" rev-parse $1 | tr -d "\n") \ + $(git -C "$REPO" rev-parse $2 | tr -d "\n") \ + >"$HTTPD_ROOT_PATH/one-time-sed" +} + +test_expect_success 'server is initially ahead - no ref in want' ' + git -C "$REPO" config uploadpack.allowRefInWant false && + rm -rf local && + cp -r "$LOCAL_PRISTINE" local && + inconsistency master 1234567890123456789012345678901234567890 && + test_must_fail git -C local fetch 2>err && + test_i18ngrep "fatal: remote error: upload-pack: not our ref" err +' + +test_expect_success 'server is initially ahead - ref in want' ' + git -C "$REPO" config uploadpack.allowRefInWant true && + rm -rf local && + cp -r "$LOCAL_PRISTINE" local && + inconsistency master 1234567890123456789012345678901234567890 && + git -C local fetch && + + git -C "$REPO" rev-parse --verify master >expected && + git -C local rev-parse --verify refs/remotes/origin/master >actual && + test_cmp expected actual +' + +test_expect_success 'server is initially behind - no ref in want' ' + git -C "$REPO" config uploadpack.allowRefInWant false && + rm -rf local && + cp -r "$LOCAL_PRISTINE" local && + inconsistency master "master^" && + git -C local fetch && + + git -C "$REPO" rev-parse --verify "master^" >expected && + git -C local rev-parse --verify refs/remotes/origin/master >actual && + test_cmp expected actual +' + +test_expect_success 'server is initially behind - ref in want' ' + git -C "$REPO" config uploadpack.allowRefInWant true && + rm -rf local && + cp -r "$LOCAL_PRISTINE" local && + inconsistency master "master^" && + git -C local fetch && + + git -C "$REPO" rev-parse --verify "master" >expected && + git -C local rev-parse --verify refs/remotes/origin/master >actual && + test_cmp expected actual +' + +test_expect_success 'server loses a ref - ref in want' ' + git -C "$REPO" config uploadpack.allowRefInWant true && + rm -rf local && + cp -r "$LOCAL_PRISTINE" local && + echo "s/master/raster/" >"$HTTPD_ROOT_PATH/one-time-sed" && + test_must_fail git -C local fetch 2>err && + + test_i18ngrep "fatal: remote error: unknown ref refs/heads/raster" err +' + +# DO NOT add non-httpd-specific tests here, because the last part of this +# test script is only executed when httpd is available and enabled. + test_done From patchwork Thu Aug 1 15:53:09 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?SZEDER_G=C3=A1bor?= X-Patchwork-Id: 11070973 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 23C3114DB for ; Thu, 1 Aug 2019 15:53:33 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 125B0200DF for ; Thu, 1 Aug 2019 15:53:33 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 04724285A7; Thu, 1 Aug 2019 15:53:33 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 71CB42844E for ; Thu, 1 Aug 2019 15:53:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732078AbfHAPxa (ORCPT ); Thu, 1 Aug 2019 11:53:30 -0400 Received: from mail-wr1-f67.google.com ([209.85.221.67]:41416 "EHLO mail-wr1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731801AbfHAPxa (ORCPT ); Thu, 1 Aug 2019 11:53:30 -0400 Received: by mail-wr1-f67.google.com with SMTP id c2so70923463wrm.8 for ; Thu, 01 Aug 2019 08:53:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=EdU9NOM3f+HsCfk1SA0uqzQnnqszZ1DIBNIE0nHRwNk=; b=MJ3dXwohzR4wyt5rnfvj3E6Z2SC4VERgTeHXogamDLacJ1ubwEv/KmpLyWZmn+u4Ls Ua8MnWjiaj5vdMcUI8oigaQyT4+If1WzMzrCoTIE4Vqr9j09F1YAzLVI9e86KNE5Upao 9Qa0L+j0QDNjUizXEBoXKOb6DtuEvftTMUjhvoYqVU5MheNNNjqMOOwxnNpjVHcXT+Lo erYBRe/rDgPN1ZmQGwp36nSgDIfAGG+3hlrhyXCjoOG8EyH6sdcUo5vKdB9++jU+IUYc oUqlKdIAuTwSuZBDmV7ttKVUmLpHJYHPiSw79ixEOkOaCZmANpaOSlvDzydw1+TKhZmS KgpQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=EdU9NOM3f+HsCfk1SA0uqzQnnqszZ1DIBNIE0nHRwNk=; b=IDapEtxdj5mdjBWFp0wzXcF8d72zjDxyLigGvFgoJ7XdrOQ/dZBOXeI1Vnthjw+7B9 dmk3A1A94jycRuMv+fKPX7vhQcxguXd9u7ZmLyXHQynT3QCzjlD9sJc3ED0dKKDAfFDi 86/4RrxqYpDQZ/OhnvO4P+9r2mAhIlYgFSWnpx5uae/slsXucAKjpqHdkPXd4gIWNtY0 E5QTxBo9loy3s8um9CD9TQnQsuAOue4EBCSxkSyzZnqrQew1ocJeY3LCo5P6y6sYSse4 C0Cx2oSO6nrKnW9+0HyXWEgBaZvu+aiJXXMJgv58w5tio0+kd7hAafciRXh3PMozfMiy bgSQ== X-Gm-Message-State: APjAAAUdv7nX4BA8zFsQo+72qmIIkTcc+01Ki+0ZPZyC+8FCeTCJGZrg LL9nNp6IohYzMuqXDC1Dvl0= X-Google-Smtp-Source: APXvYqwwZQSCIqwOzbjU2XENY4q0vjx3VpUWKK3Z653Gh3Ug47c8FQbUCdtUGRaXtP1JEaCVw+gJIQ== X-Received: by 2002:a5d:4fc8:: with SMTP id h8mr26067386wrw.177.1564674807076; Thu, 01 Aug 2019 08:53:27 -0700 (PDT) Received: from localhost.localdomain (x4dbd0ed1.dyn.telefonica.de. [77.189.14.209]) by smtp.gmail.com with ESMTPSA id g17sm55434473wrm.7.2019.08.01.08.53.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 01 Aug 2019 08:53:26 -0700 (PDT) From: =?utf-8?q?SZEDER_G=C3=A1bor?= To: Junio C Hamano Cc: Derrick Stolee , Brandon Williams , git@vger.kernel.org, =?utf-8?q?SZEDER_G=C3=A1bor?= Subject: [PATCH 3/3] tests: warn against appending non-httpd-specific tests at the end Date: Thu, 1 Aug 2019 17:53:09 +0200 Message-Id: <20190801155309.15276-4-szeder.dev@gmail.com> X-Mailer: git-send-email 2.22.0.926.g602b9a0287 In-Reply-To: <20190801155309.15276-1-szeder.dev@gmail.com> References: <20190730214000.GT20404@szeder.dev> <20190801155309.15276-1-szeder.dev@gmail.com> MIME-Version: 1.0 Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP We have a couple of test scripts that are not completely httpd-specific, but do run a few httpd-specific tests at the end. These test scripts source 'lib-httpd.sh' somewhere mid-script, which then skips all the rest of the test script if the dependencies for running httpd tests are not fulfilled. As the previous two patches in this series show, already on two occasions non-httpd-specific tests were appended at the end of such test scripts, and, consequently, they were skipped as well when httpd tests couldn't be run. Add a comment at the end of these test scripts to warn against adding non-httpd-specific tests at the end, in the hope that they will help prevent similar issues in the future. Signed-off-by: SZEDER Gábor --- t/t0410-partial-clone.sh | 3 +++ t/t5500-fetch-pack.sh | 3 +++ t/t5537-fetch-shallow.sh | 3 +++ t/t5545-push-options.sh | 3 +++ t/t5601-clone.sh | 3 +++ t/t5616-partial-clone.sh | 3 +++ t/t5700-protocol-v1.sh | 3 +++ t/t5702-protocol-v2.sh | 3 +++ 8 files changed, 24 insertions(+) diff --git a/t/t0410-partial-clone.sh b/t/t0410-partial-clone.sh index 5bd892f2f7..6415063980 100755 --- a/t/t0410-partial-clone.sh +++ b/t/t0410-partial-clone.sh @@ -518,4 +518,7 @@ test_expect_success 'fetching of missing objects from an HTTP server' ' git verify-pack --verbose "$IDX" | grep "$HASH" ' +# DO NOT add non-httpd-specific tests here, because the last part of this +# test script is only executed when httpd is available and enabled. + test_done diff --git a/t/t5500-fetch-pack.sh b/t/t5500-fetch-pack.sh index 1c71c0ec77..8210f63d41 100755 --- a/t/t5500-fetch-pack.sh +++ b/t/t5500-fetch-pack.sh @@ -920,4 +920,7 @@ test_expect_success 'fetch with --filter=blob:limit=0 and HTTP' ' fetch_filter_blob_limit_zero "$HTTPD_DOCUMENT_ROOT_PATH/server" "$HTTPD_URL/smart/server" ' +# DO NOT add non-httpd-specific tests here, because the last part of this +# test script is only executed when httpd is available and enabled. + test_done diff --git a/t/t5537-fetch-shallow.sh b/t/t5537-fetch-shallow.sh index 66f0b64d39..97a67728ca 100755 --- a/t/t5537-fetch-shallow.sh +++ b/t/t5537-fetch-shallow.sh @@ -255,4 +255,7 @@ test_expect_success 'shallow fetches check connectivity before writing shallow f git -C client fsck ' +# DO NOT add non-httpd-specific tests here, because the last part of this +# test script is only executed when httpd is available and enabled. + test_done diff --git a/t/t5545-push-options.sh b/t/t5545-push-options.sh index 6d1d59c9b1..04b34c4de1 100755 --- a/t/t5545-push-options.sh +++ b/t/t5545-push-options.sh @@ -278,4 +278,7 @@ test_expect_success 'push options keep quoted characters intact (http)' ' test_cmp expect "$HTTPD_DOCUMENT_ROOT_PATH"/upstream.git/hooks/pre-receive.push_options ' +# DO NOT add non-httpd-specific tests here, because the last part of this +# test script is only executed when httpd is available and enabled. + test_done diff --git a/t/t5601-clone.sh b/t/t5601-clone.sh index 37d76808d4..4a3b901f06 100755 --- a/t/t5601-clone.sh +++ b/t/t5601-clone.sh @@ -739,4 +739,7 @@ test_expect_success 'partial clone using HTTP' ' partial_clone "$HTTPD_DOCUMENT_ROOT_PATH/server" "$HTTPD_URL/smart/server" ' +# DO NOT add non-httpd-specific tests here, because the last part of this +# test script is only executed when httpd is available and enabled. + test_done diff --git a/t/t5616-partial-clone.sh b/t/t5616-partial-clone.sh index b91ef548f8..565254558f 100755 --- a/t/t5616-partial-clone.sh +++ b/t/t5616-partial-clone.sh @@ -417,4 +417,7 @@ test_expect_success 'tolerate server sending REF_DELTA against missing promisor ! test -e "$HTTPD_ROOT_PATH/one-time-sed" ' +# DO NOT add non-httpd-specific tests here, because the last part of this +# test script is only executed when httpd is available and enabled. + test_done diff --git a/t/t5700-protocol-v1.sh b/t/t5700-protocol-v1.sh index 7c9511c593..2571eb90b7 100755 --- a/t/t5700-protocol-v1.sh +++ b/t/t5700-protocol-v1.sh @@ -292,4 +292,7 @@ test_expect_success 'push with http:// using protocol v1' ' grep "git< version 1" log ' +# DO NOT add non-httpd-specific tests here, because the last part of this +# test script is only executed when httpd is available and enabled. + test_done diff --git a/t/t5702-protocol-v2.sh b/t/t5702-protocol-v2.sh index 011b81d4fc..fbddd0aea9 100755 --- a/t/t5702-protocol-v2.sh +++ b/t/t5702-protocol-v2.sh @@ -723,4 +723,7 @@ test_expect_success 'when server does not send "ready", expect FLUSH' ' test_i18ngrep "expected no other sections to be sent after no .ready." err ' +# DO NOT add non-httpd-specific tests here, because the last part of this +# test script is only executed when httpd is available and enabled. + test_done