From patchwork Fri Mar 25 19:24:10 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= X-Patchwork-Id: 12791968 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id F1501C433EF for ; Fri, 25 Mar 2022 19:33:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229923AbiCYTfJ (ORCPT ); Fri, 25 Mar 2022 15:35:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59494 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230325AbiCYTfB (ORCPT ); Fri, 25 Mar 2022 15:35:01 -0400 Received: from mail-wr1-x42a.google.com (mail-wr1-x42a.google.com [IPv6:2a00:1450:4864:20::42a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C07EF2806BC for ; Fri, 25 Mar 2022 12:24:20 -0700 (PDT) Received: by mail-wr1-x42a.google.com with SMTP id h23so12123221wrb.8 for ; Fri, 25 Mar 2022 12:24:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=OXsvDsz+n/QaiDucHLTg8rTNzXwcPdHqhWsqMmqkRzA=; b=g+3mZjcaovjbLpaKmUCv0s4cFtX0uQ6PlFD1TYbthLNt6IUUgEFnooFeL21mp8+XpN NXFm1+s+I2c/B+Ja43W+iBKl7eZM//4oKe1wRwWsu/ArNW0jLZZPT8mqPgUgJjrWe5u8 6jlYUaXoEt9II5y/qGhGKfGcm0fxeq1HYtmcsaf12KbWMVrPLgIgEHMBrcJuvj+ZOswN 0g49dzmipyy8Eo8/q+oc6+CUqoZkgcdQDrfj/1C0SpTnKdywNzTji5QPRGwjtT4bCWtt fUXz8VvHtbqBk5dLVVXb+ja3GlKCQ+IHdRXVq01W10dvr4wNGhiutWL4WDFog6INqx3W Qceg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=OXsvDsz+n/QaiDucHLTg8rTNzXwcPdHqhWsqMmqkRzA=; b=NrvwOryWL2rSQibr/hsVyX6bZlKB9v8/cxBlkoeRRogzAkIYQNEI2TzOEjclFo8zLg 1mKJCHbv34tlvc0+uqPKgnhc96eoTlr5clJRoV7CLOsIPtvSN97/5/EN9VqfeuV7QtzW GGwQF5yKNJQwAAZm3s5nEwbhBJJb9iowebyR418Zrj4t0QwPIrPvVJ0wPKjAzd/zIhDh IsLaMZS0w25JIU8uCrAT5DfhCWYGMmXtjQU0b9o4Wz1/Qv2GmUPyMh8JwhBanhty3BIS u25jRK/HGpMlBPr/qYze1+jTsPKzY3Aqt4VzTcS9Wuj4AJXyKrE5ghrbQSHTvx3ZUwZu OJ2w== X-Gm-Message-State: AOAM5338XkMSWmtpuIkCq6BKq6cZNhmBAAHsjEr8id6pb04vSSUuJhcT 7syQQgfNnCiGXZ7+8bovbRf70NUqtJAvJQ== X-Google-Smtp-Source: ABdhPJzMebATWzpWBtvYrX/PAVpcJ4pGBkiuQ1w9139XuYkTHLEprInn6qbYp0WpzcFNOShmihhjNA== X-Received: by 2002:a5d:504d:0:b0:203:e60e:49ef with SMTP id h13-20020a5d504d000000b00203e60e49efmr10642820wrt.546.1648236259052; Fri, 25 Mar 2022 12:24:19 -0700 (PDT) Received: from vm.nix.is (vm.nix.is. [2a01:4f8:120:2468::2]) by smtp.gmail.com with ESMTPSA id 6-20020a05600c020600b0038cbb21fb00sm4999704wmi.39.2022.03.25.12.24.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Mar 2022 12:24:18 -0700 (PDT) From: =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= To: git@vger.kernel.org Cc: Junio C Hamano , Taylor Blau , =?utf-8?q?SZEDER_G=C3=A1bor?= , =?utf-8?b?xJBvw6Bu?= =?utf-8?b?IFRy4bqnbiBDw7RuZyBEYW5o?= , =?utf-8?q?Car?= =?utf-8?q?lo_Marcelo_Arenas_Bel=C3=B3n?= , Johannes Schindelin , Victoria Dye , Matheus Tavares , Lars Schneider , Johannes Schindelin , =?utf-8?b?w4Z2YXIgQXJu?= =?utf-8?b?ZmrDtnLDsCBCamFybWFzb24=?= Subject: [RFC PATCH v3 1/6] ci: make it easier to find failed tests' logs in the GitHub workflow Date: Fri, 25 Mar 2022 20:24:10 +0100 Message-Id: X-Mailer: git-send-email 2.35.1.1517.g20a06c426a7 In-Reply-To: References: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: Johannes Schindelin When investigating a test failure, the time that matters most is the time it takes from getting aware of the failure to displaying the output of the failing test case. You currently have to know a lot of implementation details when investigating test failures in the CI runs. The first step is easy: the failed job is marked quite clearly, but when opening it, the failed step is expanded, which in our case is the one running `ci/run-build-and-tests.sh`. This step, most notably, only offers a high-level view of what went wrong: it prints the output of `prove` which merely tells the reader which test script failed. The actually interesting part is in the detailed log of said failed test script. But that log is shown in the CI run's step that runs `ci/print-test-failures.sh`. And that step is _not_ expanded in the web UI by default. It is even marked as "successful", which makes it very easy to miss that there is useful information hidden in there. Let's help the reader by showing the failed tests' detailed logs in the step that is expanded automatically, i.e. directly after the test suite failed. This also helps the situation where the _build_ failed and the `print-test-failures` step was executed under the assumption that the _test suite_ failed, and consequently failed to find any failed tests. An alternative way to implement this patch would be to source `ci/print-test-failures.sh` in the `handle_test_failures` function to show these logs. However, over the course of the next few commits, we want to introduce some grouping which would be harder to achieve that way (for example, we do want a leaner, and colored, preamble for each failed test script, and it would be trickier to accommodate the lack of nested groupings in GitHub workflows' output). Signed-off-by: Johannes Schindelin Signed-off-by: Ævar Arnfjörð Bjarmason --- .github/workflows/main.yml | 20 ++++-------------- ci/print-test-failures-github.sh | 35 ++++++++++++++++++++++++++++++++ 2 files changed, 39 insertions(+), 16 deletions(-) create mode 100755 ci/print-test-failures-github.sh diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 6d25ec4ae3b..e55dda807f0 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -129,11 +129,7 @@ jobs: shell: bash - name: test shell: bash - run: . /etc/profile && make -C t -e - - name: ci/print-test-failures.sh - if: failure() - shell: bash - run: ci/print-test-failures.sh + run: . /etc/profile && make -C t -e || ci/print-test-failures-github.sh - name: Upload failed tests' directories if: failure() && env.FAILED_TEST_ARTIFACTS != '' uses: actions/upload-artifact@v2 @@ -218,11 +214,7 @@ jobs: shell: bash - name: test shell: bash - run: . /etc/profile && make -C t -e - - name: ci/print-test-failures.sh - if: failure() - shell: bash - run: ci/print-test-failures.sh + run: . /etc/profile && make -C t -e || ci/print-test-failures-github.sh - name: Upload failed tests' directories if: failure() && env.FAILED_TEST_ARTIFACTS != '' uses: actions/upload-artifact@v2 @@ -265,10 +257,8 @@ jobs: - run: ci/lib.sh --build - run: make - run: ci/lib.sh --test - - run: make test + - run: make test || ci/print-test-failures-github.sh if: success() - - run: ci/print-test-failures.sh - if: failure() - name: Upload failed tests' directories if: failure() && env.FAILED_TEST_ARTIFACTS != '' uses: actions/upload-artifact@v2 @@ -301,10 +291,8 @@ jobs: - run: ci/lib.sh --build - run: make - run: ci/lib.sh --test - - run: make test + - run: make test || ci/print-test-failures-github.sh if: success() && matrix.vector.skip-tests != 'no' - - run: ci/print-test-failures.sh - if: failure() && matrix.vector.skip-tests != 'no' - name: Upload failed tests' directories if: failure() && env.FAILED_TEST_ARTIFACTS != '' uses: actions/upload-artifact@v1 diff --git a/ci/print-test-failures-github.sh b/ci/print-test-failures-github.sh new file mode 100755 index 00000000000..218aaf19763 --- /dev/null +++ b/ci/print-test-failures-github.sh @@ -0,0 +1,35 @@ +#!/bin/sh + +. ${0%/*}/lib-ci-type.sh + +set -e + +case "$CI_TYPE" in +github-actions) + handle_failed_tests () { + mkdir -p t/failed-test-artifacts + echo "FAILED_TEST_ARTIFACTS=t/failed-test-artifacts" >>$GITHUB_ENV + + for test_exit in t/test-results/*.exit + do + test 0 != "$(cat "$test_exit")" || continue + + test_name="${test_exit%.exit}" + test_name="${test_name##*/}" + printf "\\e[33m\\e[1m=== Failed test: ${test_name} ===\\e[m\\n" + cat "t/test-results/$test_name.out" + + trash_dir="t/trash directory.$test_name" + cp "t/test-results/$test_name.out" t/failed-test-artifacts/ + tar czf t/failed-test-artifacts/"$test_name".trash.tar.gz "$trash_dir" + done + return 1 + } + ;; +*) + echo "Unhandled CI type: $CI_TYPE" >&2 + exit 1 + ;; +esac + +handle_failed_tests From patchwork Fri Mar 25 18:37:53 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= X-Patchwork-Id: 12791945 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 89AA1C433EF for ; Fri, 25 Mar 2022 19:29:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229806AbiCYTat (ORCPT ); Fri, 25 Mar 2022 15:30:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58628 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229968AbiCYTaP (ORCPT ); Fri, 25 Mar 2022 15:30:15 -0400 Received: from mail-lf1-x129.google.com (mail-lf1-x129.google.com [IPv6:2a00:1450:4864:20::129]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 980221F379C for ; Fri, 25 Mar 2022 12:05:11 -0700 (PDT) Received: by mail-lf1-x129.google.com with SMTP id h7so14935441lfl.2 for ; Fri, 25 Mar 2022 12:05:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=2ZVj/gO4l1lswu+vSRZjq027jIUX5L/y/IDPUEWoS08=; b=VNn1VTnON8f37WqEW4oja695nU2tOi/aPMzGlnpQpFbzIUCYY7erTMeG5rTepoC+hz Sw3FNk3sv4r6m1o9D0nWnA/rWUF3Sr3YALbcXqlW6z5mbxEMbZHmrjtdBrqB704aPUJ/ 72fmRbSAUzKtKEs804H/eDYydPk+2Ff/AVL7H9+G/LrsLSLHTtPxO9+wWfOGhcJTWkld LpiS2SR5rOdOuzijB4xInv2F6+1zrkdnepBZJVoH7q2Z8ZiocDJLnomxNWPOXqNsExZs CNsXpE73WqwwB3hQ3m0dk83Tg2/bujaR9nXqnVnPTF3uRMWomqXoLg3QOE3N97ym8dDB I1lw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=2ZVj/gO4l1lswu+vSRZjq027jIUX5L/y/IDPUEWoS08=; b=D6XyNbAfbd2NfGT+psXLEGKpLyk0D/YN5uiDUeTBRup5k0RuGntw0VrcjYd2bpfmf/ T7yLwFWUBy0OVYIHfDQAxF2TsFYVSuF+2/xHydq32fkn+BSGDB96WsTwwutjPHURZ19c QyqT8uE4uy38JM61FRGpncLxpND7/sjJyTIIMUqRZfeiQXTe+PzG2zl1nD6ybluGlb7c UdUQOPWyczrqXFKStwj/1Jg5RsjkxJ0SSdee4ajaUW/SEu19ySMs3YGEIvz6kFXcAguw z2AaRm2rrceeGCs7OaQJXZyQcNChIoKOYc2L4VzL6+XKstGgc0V2KeJJBjwkEtoe6QX7 Xjig== X-Gm-Message-State: AOAM532aHaawqn2Tp66iJqfATgi42K/rfmx3pwkPUIBqwPWXTWK9mem2 W+F45W6g81J/WLdnMvt6ykJ5zeVQjhXudg== X-Google-Smtp-Source: ABdhPJzIB1tUu4LefJU+2eAU4gXCv/X/0CjMGZHMhmwcrGqlp9Zn2R8LvAvaGjjflVv1DQ3XxSzmGg== X-Received: by 2002:a5d:6b0b:0:b0:1ef:d826:723a with SMTP id v11-20020a5d6b0b000000b001efd826723amr10615435wrw.420.1648233500613; Fri, 25 Mar 2022 11:38:20 -0700 (PDT) Received: from vm.nix.is (vm.nix.is. [2a01:4f8:120:2468::2]) by smtp.gmail.com with ESMTPSA id r15-20020a5d6c6f000000b002040552e88esm6622411wrz.29.2022.03.25.11.38.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Mar 2022 11:38:20 -0700 (PDT) From: =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= To: git@vger.kernel.org Cc: Junio C Hamano , Taylor Blau , =?utf-8?q?SZEDER_G=C3=A1bor?= , =?utf-8?b?xJBvw6Bu?= =?utf-8?b?IFRy4bqnbiBDw7RuZyBEYW5o?= , =?utf-8?q?Car?= =?utf-8?q?lo_Marcelo_Arenas_Bel=C3=B3n?= , Johannes Schindelin , Victoria Dye , Matheus Tavares , Lars Schneider , =?utf-8?b?w4Z2YXIgQXJuZmrDtnI=?= =?utf-8?b?w7AgQmphcm1hc29u?= Subject: [PATCH v2 02/25] CI: make "$jobname" explicit, remove fallback Date: Fri, 25 Mar 2022 19:37:53 +0100 Message-Id: X-Mailer: git-send-email 2.35.1.1517.g20a06c426a7 In-Reply-To: References: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Remove the $jobname fallback last adjusted in b011fabd6e0 (ci/lib.sh: encapsulate Travis-specific things, 2019-01-27). This makes all of our CI jobs have an explicit $jobname, and removes the special-case of the Windows jobs implicitly setting one (that they don't currently use). In subsequent commits we'll use this new $jobname explicitly. This is a follow-up to my 25715419bf4 (CI: don't run "make test" twice in one job, 2021-11-23), since then all the jobs except the Windows jobs have had an explicit $jobname. In the case of the Windows jobs we were using a jobname of windows-gcc for both, due to picking "gcc" as a default fallback for "$CC" in ci/lib.sh. Since we'll need this to run ci/lib.sh it makes sense to move the check to the top of the file. Subsequent commits will add more such assertions to it. Signed-off-by: Ævar Arnfjörð Bjarmason --- .github/workflows/main.yml | 8 ++++++++ ci/lib.sh | 12 +++++++----- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index c35200defb9..309b9141249 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -79,6 +79,8 @@ jobs: windows-build: name: win build + env: + jobname: windows-build needs: ci-config if: needs.ci-config.outputs.enabled == 'yes' runs-on: windows-latest @@ -100,6 +102,8 @@ jobs: path: artifacts windows-test: name: win test + env: + jobname: windows-test runs-on: windows-latest needs: [windows-build] strategy: @@ -131,6 +135,8 @@ jobs: path: ${{env.FAILED_TEST_ARTIFACTS}} vs-build: name: win+VS build + env: + jobname: vs-build needs: ci-config if: needs.ci-config.outputs.enabled == 'yes' env: @@ -183,6 +189,8 @@ jobs: path: artifacts vs-test: name: win+VS test + env: + jobname: vs-test runs-on: windows-latest needs: vs-build strategy: diff --git a/ci/lib.sh b/ci/lib.sh index 57141d38a85..d2a7c33f536 100755 --- a/ci/lib.sh +++ b/ci/lib.sh @@ -6,6 +6,13 @@ # and installing dependencies. set -ex +# Starting assertions +if test -z "$jobname" +then + echo "must set a CI jobname" >&2 + exit 1 +fi + skip_branch_tip_with_tag () { # Sometimes, a branch is pushed at the same time the tag that points # at the same commit as the tip of the branch is pushed, and building @@ -146,11 +153,6 @@ test -n "${DONT_SKIP_TAGS-}" || skip_branch_tip_with_tag skip_good_tree -if test -z "$jobname" -then - jobname="$CI_OS_NAME-$CC" -fi - export DEVELOPER=1 export DEFAULT_TEST_TARGET=prove export GIT_TEST_CLONE_2GB=true From patchwork Fri Mar 25 18:37:54 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= X-Patchwork-Id: 12792000 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E99A1C433EF for ; Fri, 25 Mar 2022 19:39:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231360AbiCYTlM (ORCPT ); Fri, 25 Mar 2022 15:41:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52278 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232362AbiCYTiu (ORCPT ); Fri, 25 Mar 2022 15:38:50 -0400 Received: from mail-wm1-x329.google.com (mail-wm1-x329.google.com [IPv6:2a00:1450:4864:20::329]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 43E601DDFC0 for ; Fri, 25 Mar 2022 12:11:22 -0700 (PDT) Received: by mail-wm1-x329.google.com with SMTP id r7so4974361wmq.2 for ; Fri, 25 Mar 2022 12:11:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=cEFTrV61UmUKMl9qHSdtWgyYe4e32EF1y4Q3ASCo4AY=; b=qky+HGtLVGZKvcmMiz5Wpzxo+jnsmGYLErR2t1rMK5EV5mlIM+6V5ZFCeo1XLo71mf qRRvdyH4kJepSLcXmkMtUwhZX50z/bZm+u3eQXwaFbxcrs2wZp/xIlKXyZoVFdJvQK3s 9dAW4Qqd626pl5CZGlTX+h9EuL3+oRgKH67Z34z4/fg9wAvYx02AyQEummV0wF9q0rcH lanko91FYTlAlO8FjD6yIFXcvgyGM/PDfZXCcQvOBMC4HLXQN5g/F844USotpInzg8Tv FxHUbI2LUIyMA9nKeHMRUlxvlvqtHMdTVo+1bAbzyHu7hGxVWNl2GG2UDWs34pLuhv/k aGcw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=cEFTrV61UmUKMl9qHSdtWgyYe4e32EF1y4Q3ASCo4AY=; b=5qohCKmLiB6aRNK3jmcERN9T4gpeMp/pUcPOT8HpOxkfiWJz9Zbtp9roQEND0USAIJ PRrZgC008805+ZcJWGCV9vsU7EAAf5h9bFi/nQRXcQ5qQi8WH8jArlxcCbsF5pQJiXzE UUi1s2xArHqKqd501R7NkN4T7cCUlx8RX41iL22gke1A6YGa7PtzpPZPJZltd6iCme2/ 6Fi3DM0WKaOx/MM5KphFh+FU5N5YGfeMssueELICQRTSxCwkdi6NiXbx0CmQNezKGdki EfdJIugVUVWtRKwtjxXSPF8Q2FcUUomyTDP2mxx77+bshoNwqOqmZOOjxdesAoRSBmtt qRsw== X-Gm-Message-State: AOAM531Ne33kMsrMhvTTDmO23M8ne7XEFR6Jdliw+sgVEoZ2i+NDdx7u D9O3GFT9JC7kgVO+rXY5BZ527XMmW0gZpQ== X-Google-Smtp-Source: ABdhPJykk311JDiGXmRyPUtWcttcdyq2f7Ic72lvPUz3KOn+HYyzTXQz57FHBkiul5rzqiqOlfo37w== X-Received: by 2002:a05:600c:3493:b0:38c:7687:88f1 with SMTP id a19-20020a05600c349300b0038c768788f1mr11338508wmq.106.1648233501544; Fri, 25 Mar 2022 11:38:21 -0700 (PDT) Received: from vm.nix.is (vm.nix.is. [2a01:4f8:120:2468::2]) by smtp.gmail.com with ESMTPSA id r15-20020a5d6c6f000000b002040552e88esm6622411wrz.29.2022.03.25.11.38.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Mar 2022 11:38:20 -0700 (PDT) From: =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= To: git@vger.kernel.org Cc: Junio C Hamano , Taylor Blau , =?utf-8?q?SZEDER_G=C3=A1bor?= , =?utf-8?b?xJBvw6Bu?= =?utf-8?b?IFRy4bqnbiBDw7RuZyBEYW5o?= , =?utf-8?q?Car?= =?utf-8?q?lo_Marcelo_Arenas_Bel=C3=B3n?= , Johannes Schindelin , Victoria Dye , Matheus Tavares , Lars Schneider , =?utf-8?b?w4Z2YXIgQXJuZmrDtnI=?= =?utf-8?b?w7AgQmphcm1hc29u?= Subject: [PATCH v2 03/25] CI: remove more dead Travis CI support Date: Fri, 25 Mar 2022 19:37:54 +0100 Message-Id: X-Mailer: git-send-email 2.35.1.1517.g20a06c426a7 In-Reply-To: References: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Remove code that I missed in 4a6e4b96026 (CI: remove Travis CI support, 2021-11-23). This code was only called from or used by the now-removed .travis.yml, or needed by the Travis CI environment. For the symlinking in ci/run-build-and-tests.sh: Back when 3c93b829205 (travis-ci: build Git during the 'script' phase, 2018-01-08) and 4b060a4d973 (ci: use a junction on Windows instead of a symlink, 2019-01-27) adjusted this "ln" command, the Windows build would use ci/run-build-and-tests.sh. As seen in 889cacb6897 (ci: configure GitHub Actions for CI/PR, 2020-04-11) the current windows build uses a different entry point under the GitHub CI, which doesn't use this .prove caching. Namely "ci/run-test-slice.sh". We can be certain that it's never used in "ci/run-test-slice.sh" because to have a ".prove" file we'd need to use "--state=save", which we only do in the dead Azure codepath in ci/lib.sh. If it were used it would do the wrong thing, because the different test slices would each try to clobber the same "t/.prove" file. If a subsequent run then used the -"-state=failed,slow,save" it would defeat the purpose of "ci/run-test-slice.sh", since all slices would then run all tests. I.e. behavior of prove's "--state" options is to select tests to run from the provided "--state" file, in addition to those specified on the command-line. For ci/run-docker{,-build}.sh: It was likewise last referenced in the .travis.yml removed in my 4a6e4b96026. The current "dockerized" run in ".github/workflows/main.yml" calls the same entry points as the main "regular" job. Signed-off-by: Ævar Arnfjörð Bjarmason --- ci/lib.sh | 10 ++---- ci/print-test-failures.sh | 3 -- ci/run-build-and-tests.sh | 5 --- ci/run-docker-build.sh | 66 ----------------------------------- ci/run-docker.sh | 47 ------------------------- ci/run-test-slice.sh | 5 --- ci/util/extract-trash-dirs.sh | 50 -------------------------- 7 files changed, 2 insertions(+), 184 deletions(-) delete mode 100755 ci/run-docker-build.sh delete mode 100755 ci/run-docker.sh delete mode 100755 ci/util/extract-trash-dirs.sh diff --git a/ci/lib.sh b/ci/lib.sh index d2a7c33f536..c3c06d66862 100755 --- a/ci/lib.sh +++ b/ci/lib.sh @@ -106,9 +106,6 @@ then CI_COMMIT="$BUILD_SOURCEVERSION" CI_JOB_ID="$BUILD_BUILDID" CI_JOB_NUMBER="$BUILD_BUILDNUMBER" - CI_OS_NAME="$(echo "$AGENT_OS" | tr A-Z a-z)" - test darwin != "$CI_OS_NAME" || CI_OS_NAME=osx - CI_REPO_SLUG="$(expr "$BUILD_REPOSITORY_URI" : '.*/\([^/]*/[^/]*\)$')" CC="${CC:-gcc}" # use a subdirectory of the cache dir (because the file share is shared @@ -118,16 +115,13 @@ then export GIT_PROVE_OPTS="--timer --jobs 10 --state=failed,slow,save" export GIT_TEST_OPTS="--verbose-log -x --write-junit-xml" MAKEFLAGS="$MAKEFLAGS --jobs=10" - test windows_nt != "$CI_OS_NAME" || + test Windows_NT != "$AGENT_OS" || GIT_TEST_OPTS="--no-chain-lint --no-bin-wrappers $GIT_TEST_OPTS" elif test true = "$GITHUB_ACTIONS" then CI_TYPE=github-actions CI_BRANCH="$GITHUB_REF" CI_COMMIT="$GITHUB_SHA" - CI_OS_NAME="$(echo "$RUNNER_OS" | tr A-Z a-z)" - test macos != "$CI_OS_NAME" || CI_OS_NAME=osx - CI_REPO_SLUG="$GITHUB_REPOSITORY" CI_JOB_ID="$GITHUB_RUN_ID" CC="${CC:-gcc}" DONT_SKIP_TAGS=t @@ -137,7 +131,7 @@ then export GIT_PROVE_OPTS="--timer --jobs 10" export GIT_TEST_OPTS="--verbose-log -x" MAKEFLAGS="$MAKEFLAGS --jobs=10" - test windows != "$CI_OS_NAME" || + test Windows != "$RUNNER_OS" || GIT_TEST_OPTS="--no-chain-lint --no-bin-wrappers $GIT_TEST_OPTS" else echo "Could not identify CI type" >&2 diff --git a/ci/print-test-failures.sh b/ci/print-test-failures.sh index 57277eefcd0..00fcf27b1b2 100755 --- a/ci/print-test-failures.sh +++ b/ci/print-test-failures.sh @@ -77,9 +77,6 @@ do fi combined_trash_size=$new_combined_trash_size - # DO NOT modify these two 'echo'-ed strings below - # without updating 'ci/util/extract-trash-dirs.sh' - # as well. echo "$(tput setaf 1)Start of trash directory of '$test_name':$(tput sgr0)" cat "$trash_tgz_b64" echo "$(tput setaf 1)End of trash directory of '$test_name'$(tput sgr0)" diff --git a/ci/run-build-and-tests.sh b/ci/run-build-and-tests.sh index 280dda7d285..0a1ec8c2bae 100755 --- a/ci/run-build-and-tests.sh +++ b/ci/run-build-and-tests.sh @@ -5,11 +5,6 @@ . ${0%/*}/lib.sh -case "$CI_OS_NAME" in -windows*) cmd //c mklink //j t\\.prove "$(cygpath -aw "$cache_dir/.prove")";; -*) ln -s "$cache_dir/.prove" t/.prove;; -esac - export MAKE_TARGETS="all test" case "$jobname" in diff --git a/ci/run-docker-build.sh b/ci/run-docker-build.sh deleted file mode 100755 index 6cd832efb9c..00000000000 --- a/ci/run-docker-build.sh +++ /dev/null @@ -1,66 +0,0 @@ -#!/bin/sh -# -# Build and test Git inside container -# -# Usage: -# run-docker-build.sh -# - -set -ex - -if test $# -ne 1 || test -z "$1" -then - echo >&2 "usage: run-docker-build.sh " - exit 1 -fi - -case "$jobname" in -linux32) - switch_cmd="linux32 --32bit i386" - ;; -linux-musl) - switch_cmd= - useradd () { adduser -D "$@"; } - ;; -*) - exit 1 - ;; -esac - -"${0%/*}/install-docker-dependencies.sh" - -# If this script runs inside a docker container, then all commands are -# usually executed as root. Consequently, the host user might not be -# able to access the test output files. -# If a non 0 host user id is given, then create a user "ci" with that -# user id to make everything accessible to the host user. -HOST_UID=$1 -if test $HOST_UID -eq 0 -then - # Just in case someone does want to run the test suite as root. - CI_USER=root -else - CI_USER=ci - if test "$(id -u $CI_USER 2>/dev/null)" = $HOST_UID - then - echo "user '$CI_USER' already exists with the requested ID $HOST_UID" - else - useradd -u $HOST_UID $CI_USER - fi -fi - -# Build and test -command $switch_cmd su -m -l $CI_USER -c " - set -ex - export DEVELOPER='$DEVELOPER' - export DEFAULT_TEST_TARGET='$DEFAULT_TEST_TARGET' - export GIT_PROVE_OPTS='$GIT_PROVE_OPTS' - export GIT_TEST_OPTS='$GIT_TEST_OPTS' - export GIT_TEST_CLONE_2GB='$GIT_TEST_CLONE_2GB' - export MAKEFLAGS='$MAKEFLAGS' - export cache_dir='$cache_dir' - cd /usr/src/git - test -n '$cache_dir' && ln -s '$cache_dir/.prove' t/.prove - make - make test -" diff --git a/ci/run-docker.sh b/ci/run-docker.sh deleted file mode 100755 index af89d1624a4..00000000000 --- a/ci/run-docker.sh +++ /dev/null @@ -1,47 +0,0 @@ -#!/bin/sh -# -# Download and run Docker image to build and test Git -# - -. ${0%/*}/lib.sh - -case "$jobname" in -linux32) - CI_CONTAINER="daald/ubuntu32:xenial" - ;; -linux-musl) - CI_CONTAINER=alpine - ;; -*) - exit 1 - ;; -esac - -docker pull "$CI_CONTAINER" - -# Use the following command to debug the docker build locally: -# must be 0 if podman is used as drop-in replacement for docker -# $ docker run -itv "${PWD}:/usr/src/git" --entrypoint /bin/sh "$CI_CONTAINER" -# root@container:/# export jobname= -# root@container:/# /usr/src/git/ci/run-docker-build.sh - -container_cache_dir=/tmp/container-cache - -docker run \ - --interactive \ - --env DEVELOPER \ - --env DEFAULT_TEST_TARGET \ - --env GIT_PROVE_OPTS \ - --env GIT_TEST_OPTS \ - --env GIT_TEST_CLONE_2GB \ - --env MAKEFLAGS \ - --env jobname \ - --env cache_dir="$container_cache_dir" \ - --volume "${PWD}:/usr/src/git" \ - --volume "$cache_dir:$container_cache_dir" \ - "$CI_CONTAINER" \ - /usr/src/git/ci/run-docker-build.sh $(id -u $USER) - -check_unignored_build_artifacts - -save_good_tree diff --git a/ci/run-test-slice.sh b/ci/run-test-slice.sh index f8c2c3106a2..b9a682b4bcd 100755 --- a/ci/run-test-slice.sh +++ b/ci/run-test-slice.sh @@ -5,11 +5,6 @@ . ${0%/*}/lib.sh -case "$CI_OS_NAME" in -windows*) cmd //c mklink //j t\\.prove "$(cygpath -aw "$cache_dir/.prove")";; -*) ln -s "$cache_dir/.prove" t/.prove;; -esac - make --quiet -C t T="$(cd t && ./helper/test-tool path-utils slice-tests "$1" "$2" t[0-9]*.sh | tr '\n' ' ')" diff --git a/ci/util/extract-trash-dirs.sh b/ci/util/extract-trash-dirs.sh deleted file mode 100755 index 8e67bec21a2..00000000000 --- a/ci/util/extract-trash-dirs.sh +++ /dev/null @@ -1,50 +0,0 @@ -#!/bin/sh - -error () { - echo >&2 "error: $@" - exit 1 -} - -find_embedded_trash () { - while read -r line - do - case "$line" in - *Start\ of\ trash\ directory\ of\ \'t[0-9][0-9][0-9][0-9]-*\':*) - test_name="${line#*\'}" - test_name="${test_name%\'*}" - - return 0 - esac - done - - return 1 -} - -extract_embedded_trash () { - while read -r line - do - case "$line" in - *End\ of\ trash\ directory\ of\ \'$test_name\'*) - return - ;; - *) - printf '%s\n' "$line" - ;; - esac - done - - error "unexpected end of input" -} - -# Raw logs from Linux build jobs have CRLF line endings, while OSX -# build jobs mostly have CRCRLF, except an odd line every now and -# then that has CRCRCRLF. 'base64 -d' from 'coreutils' doesn't like -# CRs and complains about "invalid input", so remove all CRs at the -# end of lines. -sed -e 's/\r*$//' | \ -while find_embedded_trash -do - echo "Extracting trash directory of '$test_name'" - - extract_embedded_trash |base64 -d |tar xzp -done From patchwork Fri Mar 25 19:24:13 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= X-Patchwork-Id: 12791966 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 52DC9C433F5 for ; Fri, 25 Mar 2022 19:33:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230356AbiCYTfD (ORCPT ); Fri, 25 Mar 2022 15:35:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59482 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230082AbiCYTe3 (ORCPT ); Fri, 25 Mar 2022 15:34:29 -0400 Received: from mail-wr1-x42f.google.com (mail-wr1-x42f.google.com [IPv6:2a00:1450:4864:20::42f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0E1D2280C03 for ; Fri, 25 Mar 2022 12:24:23 -0700 (PDT) Received: by mail-wr1-x42f.google.com with SMTP id j18so12121894wrd.6 for ; Fri, 25 Mar 2022 12:24:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=FZI2xxi6PznYWtcgWMwuyCaFV9HWoUmAUdxMgQYduw0=; b=UFQ3Dq4AE87BpyO8R5mY3GXBR1u6mQb7u6GvzwbYDt+l90pnFha3lYyMIu1AqtAu8W sl+kK1JXvOBhwwumwPYeVsNi8NCJIhV0YjKG2hZbU0jto9YSN9164YNi9P49cVv8eOVV uLVZYnA80l+16pBslfPqNU7yse1LYLVoZDKJUNw0JOpde4JvXVldfM0jiCMtkFn9DwoZ KpgGs6kdV5pwk2h/nV78DTkc673MtUt9O9gfuFLbi1tMngvjLwfYSU6+JL7aOgc7i9ra YKJ3yd4TqXgk2pjN6d0XsP+1390vqZTODpaO/ISFFFVO9ekFbhUGtDrsP6yqx8vLqc5G F+gQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=FZI2xxi6PznYWtcgWMwuyCaFV9HWoUmAUdxMgQYduw0=; b=MQwqt1aqVF38neyvXudld4+KCTQQZulJT2QA8ZsAmug5okXI/zJ0UcZ9ep2YkYBOb+ ehdTKtZcV56eigP/s2MsA+21kkA5jZfjq3mth17F4J9jhTk7V1BcZcQRfuaGxscqhr/5 f5ZzK7/fY48jkUmynnMlHrCrreuq16SnRJS+w5rk/IYN55f8tP2n21D2K8vpiuqSFVdF IY56s7AENubIlU4iNrX2B+O9nKEpkmYrVto3qj0haxkVzQYEvo6TThhAbJqolR5Vpgpa uzKpHfz1bajQuWL7KVnO3hxW1FK6Ez06fjg5FzzJSrVRTlf8755xHc3pWfEymCaLxCj5 zZqw== X-Gm-Message-State: AOAM531SdrypdVycieV6SWz1Woghs/WaGEyoOvZZDxrJ13NHTpOvbfNi vipcUF8tAiSphjnB6fQIZZtaEfwey4u79A== X-Google-Smtp-Source: ABdhPJzxaAC3cxG7Af4h8jAVu8GOYJeVdEsVT6EAZ3fyW7WoyJ2bGgCrDLNZBxMXA8D8ATZtJp86ag== X-Received: by 2002:adf:82b2:0:b0:203:f34d:dff with SMTP id 47-20020adf82b2000000b00203f34d0dffmr10341331wrc.661.1648236261878; Fri, 25 Mar 2022 12:24:21 -0700 (PDT) Received: from vm.nix.is (vm.nix.is. [2a01:4f8:120:2468::2]) by smtp.gmail.com with ESMTPSA id 6-20020a05600c020600b0038cbb21fb00sm4999704wmi.39.2022.03.25.12.24.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Mar 2022 12:24:21 -0700 (PDT) From: =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= To: git@vger.kernel.org Cc: Junio C Hamano , Taylor Blau , =?utf-8?q?SZEDER_G=C3=A1bor?= , =?utf-8?b?xJBvw6Bu?= =?utf-8?b?IFRy4bqnbiBDw7RuZyBEYW5o?= , =?utf-8?q?Car?= =?utf-8?q?lo_Marcelo_Arenas_Bel=C3=B3n?= , Johannes Schindelin , Victoria Dye , Matheus Tavares , Lars Schneider , Johannes Schindelin , =?utf-8?b?w4Z2YXIgQXJu?= =?utf-8?b?ZmrDtnLDsCBCamFybWFzb24=?= Subject: [RFC PATCH v3 4/6] ci: optionally mark up output in the GitHub workflow Date: Fri, 25 Mar 2022 20:24:13 +0100 Message-Id: X-Mailer: git-send-email 2.35.1.1517.g20a06c426a7 In-Reply-To: References: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: Johannes Schindelin A couple of commands exist to spruce up the output in GitHub workflows: https://docs.github.com/en/actions/learn-github-actions/workflow-commands-for-github-actions In addition to the `::group::