From patchwork Wed May 25 11:25:50 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: 12861034 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 037F2C433EF for ; Wed, 25 May 2022 11:26:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239071AbiEYL01 (ORCPT ); Wed, 25 May 2022 07:26:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46178 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229835AbiEYL0X (ORCPT ); Wed, 25 May 2022 07:26:23 -0400 Received: from mail-wm1-x32b.google.com (mail-wm1-x32b.google.com [IPv6:2a00:1450:4864:20::32b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 809BA994F7 for ; Wed, 25 May 2022 04:26:22 -0700 (PDT) Received: by mail-wm1-x32b.google.com with SMTP id n124-20020a1c2782000000b003972dfca96cso3149300wmn.4 for ; Wed, 25 May 2022 04:26: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=egLKGOAL6OQbN+jgvrbBVQcSfuL+AN0CAVgLeaD+GMU=; b=q176DyNan1BcZ1eUBhRmQ2/6xbOWlPYtcSHsY4xLQNXfDsOanZL87CWuD2Io6yMXV+ c+0X9DkG4ss0HVYD+EYGaZff9N+BeX3/+pR4bX0W6yu7r8Jd9RmzVJFN9GUB1X19N/wv t7zUoA+1tqdyB2PFlXsnZCTknkq9ED8dpCpO3olTqDO6nCKqQ93qtFS0IfuMs+km1xDm uFLCONMgmwXbRSPsIbgw9gGk5x/SwdGzpKqQWNy+bG5Te9gElVaO6KnKf12uQe8vD44U RA/5z7i5hoIW1snkvC9mpI32Ct9baGgx/W20vWicO0myz4ata3n/M9nphh68VKAPY5Dt GXOA== 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=egLKGOAL6OQbN+jgvrbBVQcSfuL+AN0CAVgLeaD+GMU=; b=HzoW/Glr0FnP+XGSLQ4zJcOxCrqgFmQ5vikgYkGOJd+f2HOY18IdQZ9fbZhpR4IyRw gcVYMkhy4uwvCOM3QZSjbE1MLRF1kia9OIcoobplwCMI53vMFQC/chKr5YFCs1NEkQLZ Aly0jSF17OsshgLTa8G/ssmRMpFPoVr2+noj3wvZiQbMfFcM0/TzMOgV0/4Mtrg/s1bd 1cQYHouf1mPlke1lgGpXqu7XFs8fmaTWP2yNCYYaFIep6U6dC2yjcw1syXduO6zzmdwD IHUwW+dAqOzSi+M9Sobc9XZZjP7yjZK0M6Mgct9ciJ5YoCMj7dt02lXhavQUQaw5kSuW BuUw== X-Gm-Message-State: AOAM533KVYMedoWTM5QUANE/UJHP9HI6GsSnDuQxFg3seTt3NQjlb2GX PdE3oEAny0jgyYdqqbHIRHJbswVrIRG3oQ== X-Google-Smtp-Source: ABdhPJxerd2C7m08XaiRGBa0sEesFYfWF5IvR/h3uX+NmVaumwA5jI03BQkyx1WNTs6FlHteYeT20w== X-Received: by 2002:a7b:cd95:0:b0:397:3c5e:9639 with SMTP id y21-20020a7bcd95000000b003973c5e9639mr7842009wmj.12.1653477980847; Wed, 25 May 2022 04:26:20 -0700 (PDT) Received: from vm.nix.is (vm.nix.is. [2a01:4f8:120:2468::2]) by smtp.gmail.com with ESMTPSA id z13-20020adfd0cd000000b0020d0dfcd10asm1851095wrh.65.2022.05.25.04.26.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 May 2022 04:26: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 , Eric Sunshine , =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBC?= =?utf-8?b?amFybWFzb24=?= Subject: [PATCH v6 01/14] CI: don't "cd" in ci/print-test-failures.sh Date: Wed, 25 May 2022 13:25:50 +0200 Message-Id: X-Mailer: git-send-email 2.36.1.1045.gf356b5617dd In-Reply-To: References: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Change the logic in ci/print-test-failures.sh so that we don't need to "cd" at the top-level, we'll now only do so for the "tar" command. This way we can remove some duplicate code added in aea8879a6ac (travis-ci: include the trash directories of failed tests in the trace log, 2018-08-01), i.e. not have both a $TEST_NAME and $test_name. The output is exactly the same as before, i.e. "test-results/" was included in the heading. Signed-off-by: Ævar Arnfjörð Bjarmason --- ci/print-test-failures.sh | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/ci/print-test-failures.sh b/ci/print-test-failures.sh index ec395c79ccd..f6736f424e0 100755 --- a/ci/print-test-failures.sh +++ b/ci/print-test-failures.sh @@ -8,33 +8,36 @@ set -e . ${0%/*}/lib-ci-type.sh . ${0%/*}/lib-tput.sh -cd t/ - -if ! ls test-results/*.exit >/dev/null 2>/dev/null +if ! ls t/test-results/*.exit >/dev/null 2>/dev/null then echo "Build job failed before the tests could have been run" exit fi -for TEST_EXIT in test-results/*.exit +for TEST_EXIT in t/test-results/*.exit do if [ "$(cat "$TEST_EXIT")" != "0" ] then - TEST_OUT="${TEST_EXIT%exit}out" + TEST_NAME="${TEST_EXIT%.exit}" + TEST_NAME="${TEST_NAME##*/}" + TEST_OUT="${TEST_NAME}.out" + TEST_MARKUP="${TEST_NAME}.markup" + echo "------------------------------------------------------------------------" - echo "$(tput setaf 1)${TEST_OUT}...$(tput sgr0)" + echo "$(tput setaf 1)test-results/${TEST_OUT}...$(tput sgr0)" echo "------------------------------------------------------------------------" - cat "${TEST_OUT}" + cat "t/test-results/${TEST_OUT}" - test_name="${TEST_EXIT%.exit}" - test_name="${test_name##*/}" - trash_dir="trash directory.$test_name" + trash_dir="trash directory.$TEST_NAME" case "$CI_TYPE" in github-actions) - mkdir -p failed-test-artifacts + mkdir -p t/failed-test-artifacts echo "FAILED_TEST_ARTIFACTS=t/failed-test-artifacts" >>$GITHUB_ENV - cp "${TEST_EXIT%.exit}.out" failed-test-artifacts/ - tar czf failed-test-artifacts/"$test_name".trash.tar.gz "$trash_dir" + cp "t/test-results/${TEST_OUT}" t/failed-test-artifacts/ + ( + cd t && + tar czf failed-test-artifacts/"$TEST_NAME".trash.tar.gz "$trash_dir" + ) ;; esac fi