From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS3215 2.6.0.0/16 X-Spam-Status: No, score=-3.5 required=3.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from out1.vger.email (out1.vger.email [IPv6:2620:137:e000::1:20]) by dcvr.yhbt.net (Postfix) with ESMTP id 677691F54E for ; Wed, 27 Jul 2022 23:14:16 +0000 (UTC) Authentication-Results: dcvr.yhbt.net; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="AIO4D4/z"; dkim-atps=neutral Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234079AbiG0XON (ORCPT ); Wed, 27 Jul 2022 19:14:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41968 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234189AbiG0XOE (ORCPT ); Wed, 27 Jul 2022 19:14:04 -0400 Received: from mail-wm1-x332.google.com (mail-wm1-x332.google.com [IPv6:2a00:1450:4864:20::332]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D76764E61E for ; Wed, 27 Jul 2022 16:14:01 -0700 (PDT) Received: by mail-wm1-x332.google.com with SMTP id c22so80224wmr.2 for ; Wed, 27 Jul 2022 16:14:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc; bh=EOFI7IwXVuc67tBRMNAtCNPzjqwlgtg95pRvNx+NBGM=; b=AIO4D4/zpeIt5Pswhy79MV6oRGXFgrg7Wpu+6nElB7RHQA+sobPld00avsw+t3sU90 sDi1jpjMyl0kduQDChsKPH3lnarKTMZHA03QAEAJ1U1XxJOE/G5PB6rYqLus5/ryzXOA ZYsigbMbZCQbULvltIQgfaBUqfpctsv7itDi353tyBZpqUTVxq4aVZ2vViNkC6LODs3C HvdqmXLwncgr2OZar6RnNJtO1XxXgMgwCqzJ92jacRt1MzTSjq0t2BXtQqpZWsRLjews TITN7fl5krdlcsoRUCTj89uM1U7eQWagptfsNPBTy8uldR6PygsPG7ZXHC+z7Ut5AydN jDMA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc; bh=EOFI7IwXVuc67tBRMNAtCNPzjqwlgtg95pRvNx+NBGM=; b=S8S8Sxdf7kI3MrA5yKGPg8xfAzsNAnr3Djtvq8mOFH5u78frb5oe4X8AXJ61Vk9Bi7 qXl0QqOwAWA3O4ALe7/IyuN1xBycN+6MYd/+ESfhXoPa3HU2UbvDEUE39xhh6xzrTxFS 8U99vE/02lAWzEGHfQA9bxAU4DoLR2sItTTGL2W2CAp03JRzv/129Kdw+nW/1AEyoP/M 3rMBjsZpLaxFcnWE5nXhMXChTrFBNZy/mrAPgtbfRGq3k1nziT5H62JA+ktiKim7siaG 5pdLgDUgEKZWaRfDyE0JM2jOEPymKIvwuO0YPl94ZO93KvIWsceV+Qr2elmYzJQMHfCc LXIQ== X-Gm-Message-State: AJIora81u3RfaKKvhZaYsUYx1NG6YstoHJAXkr0s6/i0VZ4mnDX/jyoL w9B9z0golB66N3qb/sOwM6obs7oxGcVIWw== X-Google-Smtp-Source: AGRyM1txdJX+/64yZ84lObcX3r11J2QjbNm1XDbrDlP0IXz4BZ7LThhjS/wQrcV3HgMlvmdt3p/S4w== X-Received: by 2002:a1c:3886:0:b0:3a3:7ad9:b203 with SMTP id f128-20020a1c3886000000b003a37ad9b203mr3912669wma.189.1658963639524; Wed, 27 Jul 2022 16:13:59 -0700 (PDT) Received: from vm.nix.is (vm.nix.is. [2a01:4f8:120:2468::2]) by smtp.gmail.com with ESMTPSA id z3-20020adfec83000000b0021dd08ad8d7sm1692806wrn.46.2022.07.27.16.13.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Jul 2022 16:13:58 -0700 (PDT) From: =?UTF-8?q?=C3=86var=20Arnfj=C3=B6r=C3=B0=20Bjarmason?= To: git@vger.kernel.org Cc: Junio C Hamano , Derrick Stolee , =?UTF-8?q?=C3=86var=20Arnfj=C3=B6r=C3=B0=20Bjarmason?= Subject: [PATCH v3 09/15] test-lib: simplify by removing test_external Date: Thu, 28 Jul 2022 01:13:37 +0200 Message-Id: X-Mailer: git-send-email 2.37.1.1127.g4ecf1c08f67 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Remove the "test_external" function added in [1]. This arguably makes the output of t9700-perl-git.sh and friends worse. But as we'll argue below the trade-off is worth it, since "chaining" to another TAP emitter in test-lib.sh is more trouble than it's worth. The new output of t9700-perl-git.sh is now: $ ./t9700-perl-git.sh ok 1 - set up test repository ok 2 - use t9700/test.pl to test Git.pm # passed all 2 test(s) 1..2 Whereas before this change it would be: $ ./t9700-perl-git.sh ok 1 - set up test repository # run 1: Perl API (perl /home/avar/g/git/t/t9700/test.pl) ok 2 - use Git; [... omitting tests 3..46 from t/t9700/test.pl ...] ok 47 - unquote escape sequences 1..47 # test_external test Perl API was ok # test_external_without_stderr test no stderr: Perl API was ok At the time of its addition supporting "test_external" was easy, but when test-lib.sh itself started to emit TAP in [2] we needed to make everything surrounding the emission of the plan consider "test_external". I added that support in [2] so that we could run: prove ./t9700-perl-git.sh :: -v But since then in [3] the door has been closed on combining $HARNESS_ACTIVE and -v, we'll now just die: $ prove ./t9700-perl-git.sh :: -v Bailout called. Further testing stopped: verbose mode forbidden under TAP harness; try --verbose-log FAILED--Further testing stopped: verbose mode forbidden under TAP harness; try --verbose-log So the only use of this has been that *if* we had failure in one of these tests we could e.g. in CI see which test failed based on the test number. Now we'll need to look at the full verbose logs to get that same information. I think this trade-off is acceptable given the reduction in complexity, and it brings these tests in line with other similar tests, e.g. the reftable tests added in [4] will be condensed down to just one test, which invokes the C helper: $ ./t0032-reftable-unittest.sh ok 1 - unittests # passed all 1 test(s) 1..1 It would still be nice to have that ":: -v" form work again, it never *really* worked, but even though we've had edge cases test output screwing up the TAP it mostly worked between d998bd4ab67 and [3], so we may have been overzealous in forbidding it outright. I have local patches which I'm planning to submit sooner than later that get us to that goal, and in a way that isn't buggy. In the meantime getting rid of this special case makes hacking on this area of test-lib.sh easier, as we'll do in subsequent commits. The switch from "perl" to "$PERL_PATH" here is because "perl" is defined as a shell function in the test suite, see a5bf824f3b4 (t: prevent '-x' tracing from interfering with test helpers' stderr, 2018-02-25). On e.g. the OSX CI the "command perl"... will be part of the emitted stderr. 1. fb32c410087 (t/test-lib.sh: add test_external and test_external_without_stderr, 2008-06-19) 2. d998bd4ab67 (test-lib: Make the test_external_* functions TAP-aware, 2010-06-24) 3. 614fe015212 (test-lib: bail out when "-v" used under "prove", 2016-10-22) 4. ef8a6c62687 (reftable: utility functions, 2021-10-07) Signed-off-by: Ævar Arnfjörð Bjarmason --- .../netrc/t-git-credential-netrc.sh | 7 +- t/README | 26 ------ t/t0202-gettext-perl.sh | 10 +-- t/t9700-perl-git.sh | 10 +-- t/test-lib-functions.sh | 89 +------------------ t/test-lib.sh | 40 ++++----- 6 files changed, 28 insertions(+), 154 deletions(-) diff --git a/contrib/credential/netrc/t-git-credential-netrc.sh b/contrib/credential/netrc/t-git-credential-netrc.sh index ff17a9460cd..bf2777308a5 100755 --- a/contrib/credential/netrc/t-git-credential-netrc.sh +++ b/contrib/credential/netrc/t-git-credential-netrc.sh @@ -13,13 +13,10 @@ 'set up test repository' \ 'git config --add gpg.program test.git-config-gpg' - # The external test will outputs its own plan - test_external_has_tap=1 - export PERL5LIB="$GITPERLLIB" - test_external \ - 'git-credential-netrc' \ + test_expect_success 'git-credential-netrc' ' perl "$GIT_BUILD_DIR"/contrib/credential/netrc/test.pl + ' test_done ) diff --git a/t/README b/t/README index 0664aee7ed9..98f69ed13d2 100644 --- a/t/README +++ b/t/README @@ -938,32 +938,6 @@ see test-lib-functions.sh for the full list and their options. test_done fi - - test_external []