From patchwork Mon Nov 15 16:07:49 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabian Stelzer X-Patchwork-Id: 12619895 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 66AB6C433F5 for ; Mon, 15 Nov 2021 16:08:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5013661BA9 for ; Mon, 15 Nov 2021 16:08:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232343AbhKOQLb (ORCPT ); Mon, 15 Nov 2021 11:11:31 -0500 Received: from mail-ve1eur03hn2229.outbound.protection.outlook.com ([52.100.16.229]:22981 "EHLO EUR03-VE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S232281AbhKOQLU (ORCPT ); Mon, 15 Nov 2021 11:11:20 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=UfCRAvBhDc/vCHnI66ZlKT5TLwOR0lTMdnxr67sLNj+Blgn5m3FaGmE1ymrPqISFw7n90NaC+coFytfOtA8wPEsz15uK78+fIEYZXhuHyNa7HkwvpSy0Y2eQkSWRIffr/qirZhFxMbfhmTpgobceXPfHknfLQpcS0okzKS5EVLOgOiI/2dibSj1pCUGCqUffmd/yy7G+oqy8Un8gApuTOWlGAkBhKElzou1KnC7MY1ywUfpBXGCHMtjM7/Js0+Bi7aIPpIjegTlLcslNl5BCOOa6j0HF42KT9gZzcXfvEmrXV008VabfAsURmUqIIojuT0oMq3Zg5aB48gaeiAcj4A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=BECf3aWP54PAzmzxFa1LLFoVgNqLPk/Q4g7cZwQL0ls=; b=LDHuA4XYDSKnDYZw50Z2lTOocNLto73g+oqdH4pPqkoVpP9QaSmg2JDRG9A5gpeyt8Wfzq24B49pAcS8+0qawwqko4lyr+3tqfdCFYTSm8tyj35fyL3Tvpj1yLY3jm9VC5zRnYFdaDgFgS6U9K6M2JkpKg1eEgOOvHpDyJiqrJPicELXW+z51yw2+f8elsozrSZc8wMoPoaXkh8KgIq0sdOjXxwbl1vffTYOiQblFaAtsb2RUU/HtalE+5Z8yKGOQSCmplv+yhymmSLsd6n0af7T8Lb/JL3r/JSGwiOq1Hz0EIfgnqXRkcO1sYIWDbfS+SeJapoQSMP8iCwbI/AUFg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=gigacodes.de; dmarc=pass action=none header.from=gigacodes.de; dkim=pass header.d=gigacodes.de; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gigacodes.de; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=BECf3aWP54PAzmzxFa1LLFoVgNqLPk/Q4g7cZwQL0ls=; b=KyqeB2X9QBttc0VDL4lz4jKCuSZPeGjWx6+V8qFXFEVvDdIgrwlLpCNRudGhyht2f5KxqZ/pQHb9SfrJeVHQB5HeTWdwXU0T4jzr5d2ZOb+4JgWSu2aR8Se7WGZZ455JaCldCnozbETAZ2phmCnJCe1+Ve/Jvn1UrAiBQYNLtEM= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=gigacodes.de; Received: from PAXPR10MB4734.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:102:12e::15) by PR3PR10MB3866.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:102:4c::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4690.25; Mon, 15 Nov 2021 16:08:23 +0000 Received: from PAXPR10MB4734.EURPRD10.PROD.OUTLOOK.COM ([fe80::f9d5:61ab:5756:b391]) by PAXPR10MB4734.EURPRD10.PROD.OUTLOOK.COM ([fe80::f9d5:61ab:5756:b391%4]) with mapi id 15.20.4669.022; Mon, 15 Nov 2021 16:08:23 +0000 From: Fabian Stelzer To: git@vger.kernel.org Cc: Junio C Hamano , Adam Dinwoodie , Jeff King , Fabian Stelzer Subject: [PATCH 1/2] test-lib: show missing prereq summary Date: Mon, 15 Nov 2021 17:07:49 +0100 Message-Id: <20211115160750.1208940-2-fs@gigacodes.de> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20211115160750.1208940-1-fs@gigacodes.de> References: <20211115160750.1208940-1-fs@gigacodes.de> X-ClientProxiedBy: AM6PR01CA0044.eurprd01.prod.exchangelabs.com (2603:10a6:20b:e0::21) To PAXPR10MB4734.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:102:12e::15) MIME-Version: 1.0 Received: from localhost (2a02:908:178:20a0:d22:c58d:d0a4:a83a) by AM6PR01CA0044.eurprd01.prod.exchangelabs.com (2603:10a6:20b:e0::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4690.19 via Frontend Transport; Mon, 15 Nov 2021 16:08:23 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 36aa94c0-538d-46cc-2303-08d9a8522685 X-MS-TrafficTypeDiagnostic: PR3PR10MB3866: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:1850; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: uf9WT+uYUUYekGMSls6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:5;SRV:;IPV:NLI;SFV:SPM;H:PAXPR10MB4734.EURPRD10.PROD.OUTLOOK.COM;PTR:;CAT:OSPM;SFS:(4636009)(346002)(396003)(39840400004)(136003)(366004)(376002)(2906002)(66946007)(6486002)(86362001)(66556008)(186003)(8936002)(316002)(1076003)(6666004)(38100700002)(2616005)(8676002)(508600001)(52116002)(66476007)(107886003)(83380400001)(5660300002)(6916009)(36756003)(4326008)(54906003)(6496006)(23200700001);DIR:OUT;SFP:1501; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: k9jTBvM8xpvUYIreMECJmdcNrpiZcnXX5QW9G8eYYN2ykS9eGzlTOuxt7+p6piOjwr6pQlY1XLaC6eRXuf/T0LMTMisSrf/U+iqb2JuuxUBJzGKn/ZN/Kun7OjHXGGb9+xeKJUkW+CaVE+DvQS3iufhVMF1dWl5PkPtUtBHpg7IkNx1gHmXfj9ahkNdLEqp0pNVuuUO4hIoTMGzOeR9F3RGA5EtXRAN+u386gaWArvSzEOZj6jWmtYt5FNlNFW2uPCN7C7jqfsNBeoQcgm4Y87ZRqY+Wz2ICyf5Tizaf71TWxqPFEDIxkwzMVXOSu5cmF9TxKzWK/oVAN08ftg23PvCn8yL6jz9bAq4lsxOzy8L8hG2zq48SM5Pa43++QqO72tgHxYvKb6960C44UqxtBK7Z2Cju7pblpy1RPBMuJW3eKLRaaAF2LCzhh6ivIFRtihJ9oMvmrSc9HnRRNczqG4YbdsLlvAUXsm1t+Zllv4vykOL3X+SWphxtU/Sn/xC74CwQvALe4PrjAu+02s3/Yh+ddm4F5/W5ODlSRD2inWIBEHiyDLJcF+ryd2viXGvjRI0NEGlu8X3d3POo7WBAdcePdNFzV1+iUttZH+VM1EYyOgJnX7/YcnQ97KeZEahBzbCYYgVnqz490jzmOk5EOIE4+wKBhXV3yvqDOP0wJcHQdQuKNOXLJ42dEpWv9Idyqftl1shX52oGQ0K0ahkCukBm6gR3aks8W5oFzaLPqiFd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538d-46cc-2303-08d9a8522685 X-MS-Exchange-CrossTenant-AuthSource: PAXPR10MB4734.EURPRD10.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Nov 2021 16:08:23.7585 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 80e41b3b-ea1f-4dbc-91eb-225a572951fb X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: ACfBnk66xS6vDBQI30JEQTi2DMsUVKtJ35qBWqWXw5lC+op+jMipAc1Im3T94UX4FJAUK+8jdRE8/uk5GCZ8iARGfRqKWf1r8xxsVJfT+wY= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PR3PR10MB3866 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org When running the full test suite many tests can be skipped because of missing prerequisites. It not easy right now to get an overview of which ones are missing. When switching to a new machine or environment some libraries and tools might be missing or maybe a dependency broke completely. In this case the tests would indicate nothing since all dependant tests are simply skipped. This could hide broken behaviour or missing features in the build. Therefore this patch summarizes the missing prereqs at the end of the test run making it easier to spot such cases. - Add failed prereqs to the test results. - Aggregate and then show them with the totals. Signed-off-by: Fabian Stelzer --- t/aggregate-results.sh | 17 +++++++++++++++++ t/test-lib.sh | 11 +++++++++++ 2 files changed, 28 insertions(+) diff --git a/t/aggregate-results.sh b/t/aggregate-results.sh index 7913e206ed..87c16fcee1 100755 --- a/t/aggregate-results.sh +++ b/t/aggregate-results.sh @@ -6,6 +6,7 @@ success=0 failed=0 broken=0 total=0 +missing_prereq= while read file do @@ -30,10 +31,26 @@ do broken=$(($broken + $value)) ;; total) total=$(($total + $value)) ;; + missing_prereq) + missing_prereq="$missing_prereq,$value" ;; esac done <"$file" done +if test -n "$missing_prereq" +then + unique_missing_prereq=$( + echo $missing_prereq | + tr -s "," "\n" | + grep -v '^$' | + sort -u | + paste -s -d ',') + if test -n $unique_missing_prereq + then + printf "\nmissing prereq: $unique_missing_prereq\n\n" + fi +fi + if test -n "$failed_tests" then printf "\nfailed test(s):$failed_tests\n\n" diff --git a/t/test-lib.sh b/t/test-lib.sh index 2679a7596a..f61da562f6 100644 --- a/t/test-lib.sh +++ b/t/test-lib.sh @@ -669,6 +669,8 @@ test_fixed=0 test_broken=0 test_success=0 +test_missing_prereq= + test_external_has_tap=0 die () { @@ -1069,6 +1071,14 @@ test_skip () { of_prereq=" of $test_prereq" fi skipped_reason="missing $missing_prereq${of_prereq}" + + # Keep a list of all the missing prereq for result aggregation + if test -z "$missing_prereq" + then + test_missing_prereq=$missing_prereq + else + test_missing_prereq="$test_missing_prereq,$missing_prereq" + fi fi case "$to_skip" in @@ -1175,6 +1185,7 @@ test_done () { fixed $test_fixed broken $test_broken failed $test_failure + missing_prereq $test_missing_prereq EOF fi From patchwork Mon Nov 15 16:07:50 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabian Stelzer X-Patchwork-Id: 12619897 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 73BDEC433EF for ; Mon, 15 Nov 2021 16:08:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5A61861163 for ; Mon, 15 Nov 2021 16:08:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236635AbhKOQLg (ORCPT ); Mon, 15 Nov 2021 11:11:36 -0500 Received: from mail-ve1eur03hn2229.outbound.protection.outlook.com ([52.100.16.229]:22981 "EHLO EUR03-VE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S232470AbhKOQLW (ORCPT ); Mon, 15 Nov 2021 11:11:22 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Y2ICj05q51YcxKltFqaak5JFCf4BYLkwTdzT0ecyx7pkznV/DTXmdjfHve3Gz4WJ5QsWKUZtP5QCfWBgo3FaAy0WA7FOkWF0yB17/38yyV+95boDwz3Hif3SXZ9IDeHczRo6MxSsndpAM6bwCegIX6k+iWWF7/2numcL5KUCJ0zeNtZsJsYtf5z6R2k+SMTa5K48cv6Xr0XjVDjzV21hKTf3Z8Okh/dR+/XEXuGPeYHTrm4EUiDfrkznid6mMm+JYLDQKogedfen6pdqEqikSPjl9Jt8dJWVjJZVaVbi8gScOLDZA9ry7UXy31l2B4ckCm4bN3XRXg31gXFWyVku9g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=5TFI2o2dsUsTk2KYNoy7lf3FAkcqS22uclHziaas+Lo=; b=CFynz/fqmq5iSvyaO9Y3u6jGkG4SKwik40d8iQ9UHr0KRflBKOVr8iVcGKejxMrcPoS4n8wwZYuufUR7BVfXSNUA0mC4/gjj0iEyKK5RVjl2Mke646h6e6UvXAveESgM1MycCWmfEyU9L7V1fPJMEI4YTg9GadkXCImXfA9RTuU0cRBZFdI5c70vNkWr7F5UJT73t1TGmWr+GaR+Cf5TgdFDwO4Sgl03J4y5Ve+vcEhdUi5KTxdyQu0p7uDh/PsQnitvowHnhZPnUO29LxHPUQ+CuLJ156mtBw0tojGJf9gksmdij9NigH8rki1mbJCBJtv88pMGerrziQaejHlVAw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=gigacodes.de; dmarc=pass action=none header.from=gigacodes.de; dkim=pass header.d=gigacodes.de; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gigacodes.de; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=5TFI2o2dsUsTk2KYNoy7lf3FAkcqS22uclHziaas+Lo=; b=a6fPvaU3RFhA8kMDnh5dk2611ob6hlq8IWMcAi/De0oesAbha4EzaMfKjrki6pKprnLR/hdPUBRdMo9iOFWVx9zGmJtKcOIiyJDFopwkcFPzkG9rJhzLanewCSXYnzxWel3/JbECQ/0s6RYq8/FU+0kL2HxQI9ADBZS/s3guRzs= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=gigacodes.de; Received: from PAXPR10MB4734.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:102:12e::15) by PR3PR10MB3866.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:102:4c::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4690.25; Mon, 15 Nov 2021 16:08:25 +0000 Received: from PAXPR10MB4734.EURPRD10.PROD.OUTLOOK.COM ([fe80::f9d5:61ab:5756:b391]) by PAXPR10MB4734.EURPRD10.PROD.OUTLOOK.COM ([fe80::f9d5:61ab:5756:b391%4]) with mapi id 15.20.4669.022; Mon, 15 Nov 2021 16:08:25 +0000 From: Fabian Stelzer To: git@vger.kernel.org Cc: Junio C Hamano , Adam Dinwoodie , Jeff King , Fabian Stelzer Subject: [PATCH 2/2] test-lib: introduce required prereq for test runs Date: Mon, 15 Nov 2021 17:07:50 +0100 Message-Id: <20211115160750.1208940-3-fs@gigacodes.de> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20211115160750.1208940-1-fs@gigacodes.de> References: <20211115160750.1208940-1-fs@gigacodes.de> X-ClientProxiedBy: AM5P194CA0024.EURP194.PROD.OUTLOOK.COM (2603:10a6:203:8f::34) To PAXPR10MB4734.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:102:12e::15) MIME-Version: 1.0 Received: from localhost (2a02:908:178:20a0:d22:c58d:d0a4:a83a) by AM5P194CA0024.EURP194.PROD.OUTLOOK.COM (2603:10a6:203:8f::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4690.15 via Frontend Transport; Mon, 15 Nov 2021 16:08:25 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: f47421fb-f067-4677-e721-08d9a85227ae X-MS-TrafficTypeDiagnostic: PR3PR10MB3866: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:9508; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: LKz617jMWenGnpBuzcvSGNTcaWhyACQ9fNKVi7IqzobDzlFQybeSuEPuXvb396kkWnuNPT4by37R47Sc7boI+kwU6ZSzHnb+dn7ctvklbcch2UWcVD3IF5XNYsahvAk7bUpH3lk9uIX6HLPdvERfhxqFnRRK1+bsD9TcNp5hAY6JXMdp+JQ8vvHlH96pdh6/Ipf8GiSZ4z2P+H+5HuK16qf4otB6WzmfRs07/tkqlZvefiSYZQttkXqjf2IwBU4ArW0w1k0j1uKOhokzK/9JhJQzD7J+yu4YZkhsCr26/4ydZsOVEDI3MfBrDNAm/Uv2WuOdd22HfYQLvX7cEGAjVF9DiDbo73HyJTjAI8QMRgfuBhI/teqsVHhpN0OtSA/9hnCMmkQ1EYwzYd2Prij9gpRNkuVWMCx+ZVQ6/xmuDAiMOgwl+v2G+z31ZvLzpl8KDCotBdztd+AW8k+xK5AGT1HRymALkQnkuRiOZNwobuH4ZbHwjEaD8yqFqsYv0lP17AcCkqMcDybtHZdxkD7gYGO6EG+mTqOLXy46a9KYdwDjjkTDi5AGZu+QxoNXqjikyZaMJs5laizr3UmAM4/6PDsVR92z2dSuKALHA4deDzHv8Ou7mLjAtB2nQymd0Z6mkgLFo74bTybKyrSPzKRf+uAt/rL1xm4zSCZ9hlsHJ3R4z87Dp2PMFeGA6A4bUG4R70HiwYhUqDOCqdvQG3ZvDSXmw4gvm/rSaCAqYMuB+2Pdhx0nDTKkqFFSJ7flBfZOjLIyCXQgsO5HD16c5ZoahC5c+JUeQSjgI0ily79xQpkmV7aVjOUny+Rt/TnTq3UXySrNq56uRk8YNIgL+WeV+TTU+GQE8BV6b5IfRnUb2CkCs5rGIMGuo+cUYj/QP88Iz4FC8pxK8nNcsgNdRnCiNIi+oCph0N5PbYL3w9Ab0Lig1qbmv/Z5hVsPnfYIIb1chkaLxxxZxvKQ2BnHtafl4tD471RryuojBC9QJNdWXEJkOKD0KfNFvH8d7WZDEah0Jbdr+i/+OpnMsKw7lZg3yQ== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:5;SRV:;IPV:NLI;SFV:SPM;H:PAXPR10MB4734.EURPRD10.PROD.OUTLOOK.COM;PTR:;CAT:OSPM;SFS:(4636009)(346002)(396003)(39840400004)(136003)(366004)(376002)(2906002)(66946007)(6486002)(86362001)(66556008)(186003)(8936002)(316002)(1076003)(6666004)(38100700002)(2616005)(8676002)(508600001)(52116002)(66476007)(107886003)(83380400001)(5660300002)(6916009)(36756003)(4326008)(54906003)(6496006)(23200700001);DIR:OUT;SFP:1501; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: e022EglUFqWKjAwg9EZO/zvWr1IPY5lx03tBqJzYtr9mtXq4e1UDeiGh+k3bYR5QfSAZvg9XqxLlwCRVaOSk5RrSamtpeWfgPmPStW53rFpxVHSnhIQd+j7PiFyh7iM+qa59LHVKO2HRlXWzzWMS+M6DJvGdZKzSELiFmtPGq/inlDreVuZ9MXvSwFsX60l8nuzlUtCb9vcB4u+9HnF2RAx0F0JFBtGfZbbWl9ys5D4fhro5bM0LnnefB+j86YUMJN3veFsRvToWS2TFGujrL4gHaJnbkouNJ4OgqA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9tfNqtxHrnPBQnplaeVoDIbGmim7v+HrIfqQfbI3gMs34oI/5EEH/t/1zdh+Ub74GbnQtV1/TrsuMwE36UbBcvCuXsiuD9XrHasryyq/FSR8XV9xW+D3uGgU7crYWFprwKsga9evcHaScF9+OxLyItEfw5J+JimIrkxN8BA46fWRZ7gGRn+n4QN+OfWAAC9vyXbArhVQhIslmSaQGnDFSWjYRSzMmGTDE+Fwa1GIAGLkrMiRbfmU2SHjP8X3hOMZTsNVJ3ku6tsbTb86aGCc0nkF+UA2tWZpgoqj735OK7NiSWNUQFXEqJADpPcOJlDJQRf9bndVN0j42BIsqa1eqstIcCLk5FfPGxFg/AoxiAQlgFo6jw== X-OriginatorOrg: gigacodes.de X-MS-Exchange-CrossTenant-Network-Message-Id: f47421fb-f067-4677-e721-08d9a85227ae X-MS-Exchange-CrossTenant-AuthSource: PAXPR10MB4734.EURPRD10.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Nov 2021 16:08:25.7528 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 80e41b3b-ea1f-4dbc-91eb-225a572951fb X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: HHtmKvWhVQG6pADEkRphjojL/gx3o1P2gxrIk3iMo5DNzDQZxcMmupI8rFRRAC10cLYTgkbuUaQUG/iJ2XmH4x92azrjl/qUVJYDuGT9fzc= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PR3PR10MB3866 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org In certain environments or for specific test scenarios we might expect a specific prerequisite check to be succeed. Therefore we would like to trigger an error when running our tests if this is not the case. To remedy this we add the environment variable GIT_TEST_REQUIRE_PREREQ which can be set to a comma separated list of prereqs. If one of these prereq tests fail then the whole test run will abort. Signed-off-by: Fabian Stelzer --- t/README | 6 ++++++ t/test-lib-functions.sh | 11 +++++++++++ 2 files changed, 17 insertions(+) diff --git a/t/README b/t/README index 29f72354bf..18ce75976e 100644 --- a/t/README +++ b/t/README @@ -466,6 +466,12 @@ explicitly providing repositories when accessing submodule objects is complete or needs to be abandoned for whatever reason (in which case the migrated codepaths still retain their performance benefits). +GIT_TEST_REQUIRE_PREREQ= allows specifying a comma speparated list of +prereqs that are required to succeed. If a prereq in this list is triggered by +a test and then fails then the whole test run will abort. This can help to make +sure the expected tests are executed and not silently skipped when their +dependency breaks or is simply not present in a new environment. + Naming Tests ------------ diff --git a/t/test-lib-functions.sh b/t/test-lib-functions.sh index eef2262a36..2c8abf3420 100644 --- a/t/test-lib-functions.sh +++ b/t/test-lib-functions.sh @@ -680,6 +680,17 @@ test_have_prereq () { # Keep a list of missing prerequisites; restore # the negative marker if necessary. prerequisite=${negative_prereq:+!}$prerequisite + + # Abort if this prereq was marked as required + if test -n $GIT_TEST_REQUIRE_PREREQ + then + case ",$GIT_TEST_REQUIRE_PREREQ," in + *,$prerequisite,*) + error "required prereq $prerequisite failed" + ;; + esac + fi + if test -z "$missing_prereq" then missing_prereq=$prerequisite