From patchwork Mon Oct 15 10:11:59 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Arver via GitGitGadget X-Patchwork-Id: 10641487 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 48AD51057 for ; Mon, 15 Oct 2018 10:12:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2E4B32942E for ; Mon, 15 Oct 2018 10:12:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 226832946A; Mon, 15 Oct 2018 10:12:06 +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 EE7462942E for ; Mon, 15 Oct 2018 10:12:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726562AbeJOR4g (ORCPT ); Mon, 15 Oct 2018 13:56:36 -0400 Received: from mail-pg1-f194.google.com ([209.85.215.194]:36441 "EHLO mail-pg1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726469AbeJOR4f (ORCPT ); Mon, 15 Oct 2018 13:56:35 -0400 Received: by mail-pg1-f194.google.com with SMTP id f18-v6so8952570pgv.3 for ; Mon, 15 Oct 2018 03:12:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:message-id:in-reply-to:references:from:subject:fcc :content-transfer-encoding:mime-version:to:cc; bh=Cfz0Lv2WsYpAxd9NuLWiHnhKSxvt9wICkjhm8+GqqnU=; b=VfzFnG5RA1zp41af1qODgfLtJ/I6EMQOj0GiFuLQ4lS0tQ2Of1fk4dvZFXJFHN7okQ yyEqP/9MV3BWIvGLLGlGxfL07vYWYzvAZo8+2Zc/VJQ2wXyM5ulelaMKx/BjGjd3+pZv +KOGodkjMH367LspQ1fXJqioRUeNGkY0ub+ybOB1NVFYSbH+GMDo0Ns1mOOP1IgwxbPc SjsoAZSHtGHyFCyhdq95md8I3zXa8We+tXq3XjGxeZ4DFwuRZuQWkYZcb73L7n/N7Q/8 /P6zJJSc4kpEXXishK5YztGmpdkMMJiclkiODDMQvH+YXt9twXGBpwwcLTGaLKx8eN9V 5V7Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:message-id:in-reply-to:references:from :subject:fcc:content-transfer-encoding:mime-version:to:cc; bh=Cfz0Lv2WsYpAxd9NuLWiHnhKSxvt9wICkjhm8+GqqnU=; b=GqGsHXRv66NyjrPj9Le8zj3ZobeSiKIBE6KTMRIpQ1pSUwIrIZlxA3MR+VvbEJdHH+ Hg+ASlAu7nJSyZVlBMRCrWIwUxNOPj4C+mpixOeLwELvbtcKkKZ6K5i1EYergUJG5Gl7 7iAxRDPkdh9nSL4Sp7Nbtz0FXxqsv0bBV0MybkCD5PhLGrBdAo0V1U3BU0otY3fPW0TN tiaz8RhQU4pY1F6z6XCnNnYBTDo5j2ls/t8ZegEc2Xn/v/W5rF4emCp+OMFGuxRUJ8+r M6DGeCuc02ZpsF7dbzbL5zmwsBTg86EuwCBZ/fkP4sXXPJbX/uOWVtiFfdihT19XTpMQ p27w== X-Gm-Message-State: ABuFfogWiCCzuGyPPt/Qdtzobjt8w442bqQGv1f72BbOEsyrmCxr9ngH K9PPpGH4RQazeANQ/PTny8WZcQeF X-Google-Smtp-Source: ACcGV60PgFFe0YsEe/CkETVXobQlOXEnb4v9lNJ6y+EjUq5AaZxnvrpjpLSqqJQSh4/SdBrEJXz4ew== X-Received: by 2002:a62:507:: with SMTP id 7-v6mr16961123pff.80.1539598320259; Mon, 15 Oct 2018 03:12:00 -0700 (PDT) Received: from [127.0.0.1] ([40.112.137.127]) by smtp.gmail.com with ESMTPSA id q2-v6sm14636558pfc.17.2018.10.15.03.11.58 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 15 Oct 2018 03:11:59 -0700 (PDT) Date: Mon, 15 Oct 2018 03:11:59 -0700 (PDT) X-Google-Original-Date: Mon, 15 Oct 2018 10:11:43 GMT Message-Id: In-Reply-To: References: From: "Johannes Schindelin via GitGitGadget" Subject: [PATCH v2 01/13] ci: rename the library of common functions Fcc: Sent MIME-Version: 1.0 To: git@vger.kernel.org Cc: Junio C Hamano , Johannes Schindelin Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Johannes Schindelin The name is hard-coded to reflect that we use Travis CI for continuous testing. In the next commits, we will extend this to be able use Azure DevOps, too. So let's adjust the name to make it more generic. Signed-off-by: Johannes Schindelin --- ci/install-dependencies.sh | 2 +- ci/{lib-travisci.sh => lib.sh} | 0 ci/print-test-failures.sh | 2 +- ci/run-build-and-tests.sh | 2 +- ci/run-linux32-docker.sh | 2 +- ci/run-static-analysis.sh | 2 +- ci/run-windows-build.sh | 2 +- ci/test-documentation.sh | 2 +- 8 files changed, 7 insertions(+), 7 deletions(-) rename ci/{lib-travisci.sh => lib.sh} (100%) diff --git a/ci/install-dependencies.sh b/ci/install-dependencies.sh index 75a9fd2475..961064658e 100755 --- a/ci/install-dependencies.sh +++ b/ci/install-dependencies.sh @@ -3,7 +3,7 @@ # Install dependencies required to build and test Git on Linux and macOS # -. ${0%/*}/lib-travisci.sh +. ${0%/*}/lib.sh P4WHENCE=http://filehost.perforce.com/perforce/r$LINUX_P4_VERSION LFSWHENCE=https://github.com/github/git-lfs/releases/download/v$LINUX_GIT_LFS_VERSION diff --git a/ci/lib-travisci.sh b/ci/lib.sh similarity index 100% rename from ci/lib-travisci.sh rename to ci/lib.sh diff --git a/ci/print-test-failures.sh b/ci/print-test-failures.sh index d55460a212..7aef39a2fd 100755 --- a/ci/print-test-failures.sh +++ b/ci/print-test-failures.sh @@ -3,7 +3,7 @@ # Print output of failing tests # -. ${0%/*}/lib-travisci.sh +. ${0%/*}/lib.sh # Tracing executed commands would produce too much noise in the loop below. set +x diff --git a/ci/run-build-and-tests.sh b/ci/run-build-and-tests.sh index 2a5bff4a1c..e28ac2fb9a 100755 --- a/ci/run-build-and-tests.sh +++ b/ci/run-build-and-tests.sh @@ -3,7 +3,7 @@ # Build and test Git # -. ${0%/*}/lib-travisci.sh +. ${0%/*}/lib.sh ln -s "$cache_dir/.prove" t/.prove diff --git a/ci/run-linux32-docker.sh b/ci/run-linux32-docker.sh index 21637903ce..751acfcf8a 100755 --- a/ci/run-linux32-docker.sh +++ b/ci/run-linux32-docker.sh @@ -3,7 +3,7 @@ # Download and run Docker image to build and test 32-bit Git # -. ${0%/*}/lib-travisci.sh +. ${0%/*}/lib.sh docker pull daald/ubuntu32:xenial diff --git a/ci/run-static-analysis.sh b/ci/run-static-analysis.sh index 5688f261d0..dc189c7456 100755 --- a/ci/run-static-analysis.sh +++ b/ci/run-static-analysis.sh @@ -3,7 +3,7 @@ # Perform various static code analysis checks # -. ${0%/*}/lib-travisci.sh +. ${0%/*}/lib.sh make --jobs=2 coccicheck diff --git a/ci/run-windows-build.sh b/ci/run-windows-build.sh index d99a180e52..a73a4eca0a 100755 --- a/ci/run-windows-build.sh +++ b/ci/run-windows-build.sh @@ -6,7 +6,7 @@ # supported) and a commit hash. # -. ${0%/*}/lib-travisci.sh +. ${0%/*}/lib.sh test $# -ne 2 && echo "Unexpected number of parameters" && exit 1 test -z "$GFW_CI_TOKEN" && echo "GFW_CI_TOKEN not defined" && exit diff --git a/ci/test-documentation.sh b/ci/test-documentation.sh index a20de9ca12..d3cdbac73f 100755 --- a/ci/test-documentation.sh +++ b/ci/test-documentation.sh @@ -3,7 +3,7 @@ # Perform sanity checks on documentation and build it. # -. ${0%/*}/lib-travisci.sh +. ${0%/*}/lib.sh gem install asciidoctor From patchwork Mon Oct 15 10:12:00 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Arver via GitGitGadget X-Patchwork-Id: 10641497 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 A48C03C13 for ; Mon, 15 Oct 2018 10:12:09 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 920DA28C82 for ; Mon, 15 Oct 2018 10:12:09 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8628D2941A; Mon, 15 Oct 2018 10:12:09 +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 76CF528C82 for ; Mon, 15 Oct 2018 10:12:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726576AbeJOR4h (ORCPT ); Mon, 15 Oct 2018 13:56:37 -0400 Received: from mail-pf1-f196.google.com ([209.85.210.196]:46635 "EHLO mail-pf1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726515AbeJOR4h (ORCPT ); Mon, 15 Oct 2018 13:56:37 -0400 Received: by mail-pf1-f196.google.com with SMTP id r64-v6so9423946pfb.13 for ; Mon, 15 Oct 2018 03:12:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:message-id:in-reply-to:references:from:subject:fcc :content-transfer-encoding:mime-version:to:cc; bh=HYRUrkv2eVVl+KJvYm7lRGxV6IZq3rh3x1uBk2xE/NA=; b=GaqVkKj2VwZ7GvrNobSdix5e+Goao8SOkJpmsOPG+2LKqUJy6orneGRquKovq4xA8T NkofzKp6c/W3e4DCAGG7IrUZgTs4n/gPnKP2fxZV+xETfil3+Zvnf5OcwjqzHlwy/UR6 83uZMNn3kd+QkU9f0gTucDlx1ghRvMAX8pfVPugkNcrNTfgscuQVF3nLwrwbWFk8yRUz fo1ndqnL513EVKS/Y74LZKEqsiHHXfz09TFVpTdXJhlECe3O+H1Firz5VWdd50d4WtXi E1pkjqgaQ7DNP5kSquo8brN7axdzULMOSOrKibQTn/8G3SQyvqsWmZfG9oQVMTe2w5um nv4A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:message-id:in-reply-to:references:from :subject:fcc:content-transfer-encoding:mime-version:to:cc; bh=HYRUrkv2eVVl+KJvYm7lRGxV6IZq3rh3x1uBk2xE/NA=; b=o+Q2C96Ua0B5S6LcuAINLGL9QNSlYSgW8puDm0oIxtVwKwqProBdNFPK4BUD7ZFcYT E+0dFmgIfu63R4eYgjYPsP+PphqGH05GYKxegn8+WrkM9/g7eojif+B17H0/qAMC12M+ TwhOWSl+PohSTIKsQG+OoyZmHVqZml4aJejyVYM9B9jk1RLf7GqNFBD42JfV19ZyVioo 8J+ov3dxHirqFtUJnNjukMx+69kJmcnEQmNyCjzsnFw7y4baE/67RC4jwozrLdS+vjQY 8jOmlf46f2zZvnmUrDtpn+u6YRLhXOE4gg0BUElCm6Q/F1BrlJqZ64HDTkGFVeNyQ+BX omDA== X-Gm-Message-State: ABuFfojCnGQJwHnIO7OXnFaBFndi4d6r7kLDPD6nHEhSynWqTML8P9MO 0g97tPBD1i+sUZmCiY6fLDlWq3ta X-Google-Smtp-Source: ACcGV62kvCc7Jz5GJsvfaWVBmVA42Ae0vumWtkTx830x18x+Bin4RJNxq4Y7bBL/iY0buT3GRQChkw== X-Received: by 2002:a62:b50a:: with SMTP id y10-v6mr16794619pfe.199.1539598321790; Mon, 15 Oct 2018 03:12:01 -0700 (PDT) Received: from [127.0.0.1] ([40.112.137.127]) by smtp.gmail.com with ESMTPSA id v38-v6sm15859380pgn.57.2018.10.15.03.12.00 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 15 Oct 2018 03:12:00 -0700 (PDT) Date: Mon, 15 Oct 2018 03:12:00 -0700 (PDT) X-Google-Original-Date: Mon, 15 Oct 2018 10:11:44 GMT Message-Id: <815152e0f57d545ae2fae7429c16e5be497746be.1539598316.git.gitgitgadget@gmail.com> In-Reply-To: References: From: "Johannes Schindelin via GitGitGadget" Subject: [PATCH v2 02/13] ci/lib.sh: encapsulate Travis-specific things Fcc: Sent MIME-Version: 1.0 To: git@vger.kernel.org Cc: Junio C Hamano , Johannes Schindelin Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Johannes Schindelin The upcoming patches will allow building git.git via Azure Pipelines (i.e. Azure DevOps' Continuous Integration), where variable names and URLs look a bit different than in Travis CI. Signed-off-by: Johannes Schindelin --- ci/install-dependencies.sh | 3 ++- ci/lib.sh | 44 +++++++++++++++++++++++++++----------- ci/print-test-failures.sh | 2 +- ci/test-documentation.sh | 1 + 4 files changed, 35 insertions(+), 15 deletions(-) diff --git a/ci/install-dependencies.sh b/ci/install-dependencies.sh index 961064658e..63fa37f68f 100755 --- a/ci/install-dependencies.sh +++ b/ci/install-dependencies.sh @@ -28,7 +28,8 @@ osx-clang|osx-gcc) brew update --quiet # Uncomment this if you want to run perf tests: # brew install gnu-time - brew install git-lfs gettext + test -z "$BREW_INSTALL_PACKAGES" || + brew install $BREW_INSTALL_PACKAGES brew link --force gettext brew install caskroom/cask/perforce ;; diff --git a/ci/lib.sh b/ci/lib.sh index 06970f7213..8532555b4e 100755 --- a/ci/lib.sh +++ b/ci/lib.sh @@ -1,5 +1,26 @@ # Library of functions shared by all CI scripts +if test true = "$TRAVIS" +then + # We are running within Travis CI + CI_BRANCH="$TRAVIS_BRANCH" + CI_COMMIT="$TRAVIS_COMMIT" + CI_JOB_ID="$TRAVIS_JOB_ID" + CI_JOB_NUMBER="$TRAVIS_JOB_NUMBER" + CI_OS_NAME="$TRAVIS_OS_NAME" + CI_REPO_SLUG="$TRAVIS_REPO_SLUG" + + cache_dir="$HOME/travis-cache" + + url_for_job_id () { + echo "https://travis-ci.org/$CI_REPO_SLUG/jobs/$1" + } + + BREW_INSTALL_PACKAGES="git-lfs gettext" + export GIT_PROVE_OPTS="--timer --jobs 3 --state=failed,slow,save" + export GIT_TEST_OPTS="--verbose-log -x --immediate" +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 @@ -13,10 +34,10 @@ skip_branch_tip_with_tag () { # we can skip the build because we won't be skipping a build # of a tag. - if TAG=$(git describe --exact-match "$TRAVIS_BRANCH" 2>/dev/null) && - test "$TAG" != "$TRAVIS_BRANCH" + if TAG=$(git describe --exact-match "$CI_BRANCH" 2>/dev/null) && + test "$TAG" != "$CI_BRANCH" then - echo "$(tput setaf 2)Tip of $TRAVIS_BRANCH is exactly at $TAG$(tput sgr0)" + echo "$(tput setaf 2)Tip of $CI_BRANCH is exactly at $TAG$(tput sgr0)" exit 0 fi } @@ -25,7 +46,7 @@ skip_branch_tip_with_tag () { # job if we encounter the same tree again and can provide a useful info # message. save_good_tree () { - echo "$(git rev-parse $TRAVIS_COMMIT^{tree}) $TRAVIS_COMMIT $TRAVIS_JOB_NUMBER $TRAVIS_JOB_ID" >>"$good_trees_file" + echo "$(git rev-parse $CI_COMMIT^{tree}) $CI_COMMIT $CI_JOB_NUMBER $CI_JOB_ID" >>"$good_trees_file" # limit the file size tail -1000 "$good_trees_file" >"$good_trees_file".tmp mv "$good_trees_file".tmp "$good_trees_file" @@ -35,7 +56,7 @@ save_good_tree () { # successfully before (e.g. because the branch got rebased, changing only # the commit messages). skip_good_tree () { - if ! good_tree_info="$(grep "^$(git rev-parse $TRAVIS_COMMIT^{tree}) " "$good_trees_file")" + if ! good_tree_info="$(grep "^$(git rev-parse $CI_COMMIT^{tree}) " "$good_trees_file")" then # Haven't seen this tree yet, or no cached good trees file yet. # Continue the build job. @@ -45,18 +66,18 @@ skip_good_tree () { echo "$good_tree_info" | { read tree prev_good_commit prev_good_job_number prev_good_job_id - if test "$TRAVIS_JOB_ID" = "$prev_good_job_id" + if test "$CI_JOB_ID" = "$prev_good_job_id" then cat <<-EOF - $(tput setaf 2)Skipping build job for commit $TRAVIS_COMMIT.$(tput sgr0) + $(tput setaf 2)Skipping build job for commit $CI_COMMIT.$(tput sgr0) This commit has already been built and tested successfully by this build job. To force a re-build delete the branch's cache and then hit 'Restart job'. EOF else cat <<-EOF - $(tput setaf 2)Skipping build job for commit $TRAVIS_COMMIT.$(tput sgr0) + $(tput setaf 2)Skipping build job for commit $CI_COMMIT.$(tput sgr0) This commit's tree has already been built and tested successfully in build job $prev_good_job_number for commit $prev_good_commit. - The log of that build job is available at https://travis-ci.org/$TRAVIS_REPO_SLUG/jobs/$prev_good_job_id + The log of that build job is available at $(url_for_job_id $prev_good_job_id) To force a re-build delete the branch's cache and then hit 'Restart job'. EOF fi @@ -81,7 +102,6 @@ check_unignored_build_artifacts () # and installing dependencies. set -ex -cache_dir="$HOME/travis-cache" good_trees_file="$cache_dir/good-trees" mkdir -p "$cache_dir" @@ -91,13 +111,11 @@ skip_good_tree if test -z "$jobname" then - jobname="$TRAVIS_OS_NAME-$CC" + jobname="$CI_OS_NAME-$CC" fi export DEVELOPER=1 export DEFAULT_TEST_TARGET=prove -export GIT_PROVE_OPTS="--timer --jobs 3 --state=failed,slow,save" -export GIT_TEST_OPTS="--verbose-log -x --immediate" export GIT_TEST_CLONE_2GB=YesPlease if [ "$jobname" = linux-gcc ]; then export CC=gcc-8 diff --git a/ci/print-test-failures.sh b/ci/print-test-failures.sh index 7aef39a2fd..d2045b63a6 100755 --- a/ci/print-test-failures.sh +++ b/ci/print-test-failures.sh @@ -69,7 +69,7 @@ do fi done -if [ $combined_trash_size -gt 0 ] +if [ -n "$TRAVIS_JOB_ID" -a $combined_trash_size -gt 0 ] then echo "------------------------------------------------------------------------" echo "Trash directories embedded in this log can be extracted by running:" diff --git a/ci/test-documentation.sh b/ci/test-documentation.sh index d3cdbac73f..7d0beb2832 100755 --- a/ci/test-documentation.sh +++ b/ci/test-documentation.sh @@ -5,6 +5,7 @@ . ${0%/*}/lib.sh +test -n "$ALREADY_HAVE_ASCIIDOCTOR" || gem install asciidoctor make check-builtins From patchwork Mon Oct 15 10:12:02 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Arver via GitGitGadget X-Patchwork-Id: 10641489 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 9834A15E2 for ; Mon, 15 Oct 2018 10:12:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 82F4629270 for ; Mon, 15 Oct 2018 10:12:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 776C429456; Mon, 15 Oct 2018 10:12:06 +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 DE96E29270 for ; Mon, 15 Oct 2018 10:12:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726598AbeJOR4j (ORCPT ); Mon, 15 Oct 2018 13:56:39 -0400 Received: from mail-pl1-f195.google.com ([209.85.214.195]:46840 "EHLO mail-pl1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726515AbeJOR4i (ORCPT ); Mon, 15 Oct 2018 13:56:38 -0400 Received: by mail-pl1-f195.google.com with SMTP id v5-v6so9057202plz.13 for ; Mon, 15 Oct 2018 03:12:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:message-id:in-reply-to:references:from:subject:fcc :content-transfer-encoding:mime-version:to:cc; bh=bnpLIlyyLtIXH9ZdKeZynSDp+QyusEe60+Hv8ehTygc=; b=Qixu0+594VQ0/19sUvL9kmmFKV8eejYn92/4YsWlF2ZuymVIfEQO2wZMyoKoWC1tdf Y0GSax9lkB1BXVaVBH/sfcp04PRp8cDy9J1mOLGCdgbjynF9Pa8/MO1eGQyfdA3FQr6y CgWUuFKszJ8M4LmgtGR6dHxbT7PHpG73hYF9s3Z3/xZIO38W9Bo993c1PLKl72R5QH5T 6/sSUgIHicM0LN8HxOypyhc1PRtZF6tVXSUCT5CRFgq9eoUgdaWjM+9kxhz+Y94VjZtI Ig3LcYDZY5fK2NOernl/M3aMS74Tfc5hnJD5TWDzEpnR/DxvK+muBGPlZmuonyvnqiNO bvWA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:message-id:in-reply-to:references:from :subject:fcc:content-transfer-encoding:mime-version:to:cc; bh=bnpLIlyyLtIXH9ZdKeZynSDp+QyusEe60+Hv8ehTygc=; b=jTkp0QTHhxGgH6ZeMlXM/1dnyu9lCZoVGubfFd8gnuAxcDdtwH5D81PfvrfdIxPX7b gLi0qXC3Hmd82PM4+/qSZi2Dq4YF0OFdRMPv6etl6zSY0ElaHG/pQ1TKcwdET2LRXDv1 t/GzT176vUgIlf+5B1QcldRtKxu5M/zB2QngX0NY5pqDw6GV0RMsZ+f1gAbaguLhMU/K qIopWrhXj9/nD0H78C7Rs/Isj4MN7F0sPFemkJhY55Y0RyqQVYaSqIEF7MkWaBkr5ciZ +1wd2DHQBVl7QdIEoL+WUiutAlLBJjQJtUTh49uKx42ublTOheFcDgdiDv61tjPYJITw zLDw== X-Gm-Message-State: ABuFfoias7YrCiw22WrXDrtkhgCwjVljUA8wlaCsAaV3u2C7cZlBnPay Ww5HP0OLoi1V6AkUCRMrptecxyWd X-Google-Smtp-Source: ACcGV63nfYcNQEEvhpJocRHcslBRw3/eQyGdBDYi9PfGAPVjqE/JocuJFvIQtV1eScEifk/jH9aXNw== X-Received: by 2002:a17:902:5602:: with SMTP id h2-v6mr16331279pli.220.1539598323449; Mon, 15 Oct 2018 03:12:03 -0700 (PDT) Received: from [127.0.0.1] ([40.112.137.127]) by smtp.gmail.com with ESMTPSA id s2-v6sm10571350pgo.90.2018.10.15.03.12.02 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 15 Oct 2018 03:12:02 -0700 (PDT) Date: Mon, 15 Oct 2018 03:12:02 -0700 (PDT) X-Google-Original-Date: Mon, 15 Oct 2018 10:11:45 GMT Message-Id: <52337f18750e16a9ba3bb11e9c2f3748f438846c.1539598316.git.gitgitgadget@gmail.com> In-Reply-To: References: From: "Johannes Schindelin via GitGitGadget" Subject: [PATCH v2 03/13] test-date: add a subcommand to measure times in shell scripts Fcc: Sent MIME-Version: 1.0 To: git@vger.kernel.org Cc: Junio C Hamano , Johannes Schindelin Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Johannes Schindelin In the next commit, we want to teach Git's test suite to optionally output test results in JUnit-style .xml files. These files contain information about the time spent. So we need a way to measure time. While we could use `date +%s` for that, this will give us only seconds, i.e. very coarse-grained timings. GNU `date` supports `date +%s.%N` (i.e. nanosecond-precision output), but there is no equivalent in BSD `date` (read: on macOS, we would not be able to obtain precise timings). So let's introduce `test-tool date getnanos`, with an optional start time, that outputs preciser values. Granted, it is a bit pointless to try measuring times accurately in shell scripts, certainly to nanosecond precision. But it is better than second-granularity. Signed-off-by: Johannes Schindelin --- t/helper/test-date.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/t/helper/test-date.c b/t/helper/test-date.c index a0837371ab..792a805374 100644 --- a/t/helper/test-date.c +++ b/t/helper/test-date.c @@ -7,6 +7,7 @@ static const char *usage_msg = "\n" " test-tool date parse [date]...\n" " test-tool date approxidate [date]...\n" " test-tool date timestamp [date]...\n" +" test-tool date getnanos [start-nanos]\n" " test-tool date is64bit\n" " test-tool date time_t-is64bit\n"; @@ -82,6 +83,15 @@ static void parse_approx_timestamp(const char **argv, struct timeval *now) } } +static void getnanos(const char **argv, struct timeval *now) +{ + double seconds = getnanotime() / 1.0e9; + + if (*argv) + seconds -= strtod(*argv, NULL); + printf("%lf\n", seconds); +} + int cmd__date(int argc, const char **argv) { struct timeval now; @@ -108,6 +118,8 @@ int cmd__date(int argc, const char **argv) parse_approxidate(argv+1, &now); else if (!strcmp(*argv, "timestamp")) parse_approx_timestamp(argv+1, &now); + else if (!strcmp(*argv, "getnanos")) + getnanos(argv+1, &now); else if (!strcmp(*argv, "is64bit")) return sizeof(timestamp_t) == 8 ? 0 : 1; else if (!strcmp(*argv, "time_t-is64bit")) From patchwork Mon Oct 15 10:12:04 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Arver via GitGitGadget X-Patchwork-Id: 10641493 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 0A3791057 for ; Mon, 15 Oct 2018 10:12:09 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EADF729270 for ; Mon, 15 Oct 2018 10:12:08 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DEC8E29456; Mon, 15 Oct 2018 10:12:08 +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 C823129270 for ; Mon, 15 Oct 2018 10:12:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726636AbeJOR4l (ORCPT ); Mon, 15 Oct 2018 13:56:41 -0400 Received: from mail-pg1-f180.google.com ([209.85.215.180]:40111 "EHLO mail-pg1-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726515AbeJOR4k (ORCPT ); Mon, 15 Oct 2018 13:56:40 -0400 Received: by mail-pg1-f180.google.com with SMTP id n31-v6so8936888pgm.7 for ; Mon, 15 Oct 2018 03:12:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:message-id:in-reply-to:references:from:subject:fcc :content-transfer-encoding:mime-version:to:cc; bh=gPWGZ2JCNoc3E32GHvBNMmbF54a9B105ZM2Iy8SOCJM=; b=qWI7EwOG8P9u4YERwiDlbJ3jCFM+7tGZADwAsUURyxPL3IzCeELkLh+xjJhevhY2tl tUEYdRowyB8ofr/ZGqGGYn0GJnow7BpRXjOAvc5b2hO2IBkJkGaLmy7vrTwU1G6dZ/Dh 0f+9ho8knuxisNgo8osMg6RVxJzSNU6oHt7MRvRPeTVHgI6fEhxxlbrWt4dzYB3RAOTw RMkk/vMH8ZfvLZAfHBy9c5tIX5PM2Pc3Fgx3Fgg89RPhHvstYqKAbtggM7qwKMBYkghl +AyV6SFQ4HQrMX1inrWEB+44ffC6k0hS/gE5BNxMAfNSxAX3cR4pV+YiSSrKm936GzSL DTLA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:message-id:in-reply-to:references:from :subject:fcc:content-transfer-encoding:mime-version:to:cc; bh=gPWGZ2JCNoc3E32GHvBNMmbF54a9B105ZM2Iy8SOCJM=; b=QoiiEwQheJZqK2Fr4CVCTZ6oqyQZnsZzpfb6TNobWVhtXNWHDmAwnL1N58lVlHZ/c2 kZ5/FejRexJ8DL2tMzoB7WwsUj8eTul4Gyq468StVum/d1I9AdwIK8bilrCsD2PRsioU 7sRv0PMOOfk4u6CeqO3wMcwgxldyjGoG4ALIbTF5L6bJFTshULqWzjg6kQz+dRQGHrqf rBsZGNKWtHM8ItNsmofaMZCQ+hlUROcWwmxtAvKjCvyRLAlL94vNAbX4HqVTEJXzC1vT yWYV22ObGIl6Aqg61z25OnqA+Y3l8er727yxkY2EtfUVKzaf/6aVGKWzhcZwGeQ03jfS Fwyw== X-Gm-Message-State: ABuFfoiYhl8UlJRJyqK2uXC6GTvTm12ATg2dFCTeGfEoAYBYxUN3rB7z lS/bD4IfXQ35kXt1LhAMcTvZZVuO X-Google-Smtp-Source: ACcGV61qcBQg+NOwBEYIpL4kaTVFbnJTEeJP/vX8/qaM7gCsuKuGNUeObqIRaOsFZNiDL9IgXhmvEA== X-Received: by 2002:a62:9fc4:: with SMTP id v65-v6mr17071182pfk.130.1539598324830; Mon, 15 Oct 2018 03:12:04 -0700 (PDT) Received: from [127.0.0.1] ([40.112.137.127]) by smtp.gmail.com with ESMTPSA id 68-v6sm13286480pfg.136.2018.10.15.03.12.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 15 Oct 2018 03:12:04 -0700 (PDT) Date: Mon, 15 Oct 2018 03:12:04 -0700 (PDT) X-Google-Original-Date: Mon, 15 Oct 2018 10:11:46 GMT Message-Id: In-Reply-To: References: From: "Johannes Schindelin via GitGitGadget" Subject: [PATCH v2 04/13] tests: optionally write results as JUnit-style .xml Fcc: Sent MIME-Version: 1.0 To: git@vger.kernel.org Cc: Junio C Hamano , Johannes Schindelin Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Johannes Schindelin This will come in handy when publishing the results of Git's test suite during an automated Azure DevOps run. Signed-off-by: Johannes Schindelin --- t/.gitignore | 1 + t/test-lib.sh | 98 +++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 99 insertions(+) diff --git a/t/.gitignore b/t/.gitignore index 348715f0e4..91cf5772fe 100644 --- a/t/.gitignore +++ b/t/.gitignore @@ -2,3 +2,4 @@ /test-results /.prove /chainlinttmp +/out/ diff --git a/t/test-lib.sh b/t/test-lib.sh index 3f95bfda60..7ed0013f6d 100644 --- a/t/test-lib.sh +++ b/t/test-lib.sh @@ -288,6 +288,9 @@ do --verbose-log) verbose_log=t shift ;; + --write-junit-xml) + write_junit_xml=t + shift ;; *) echo "error: unknown test option '$1'" >&2; exit 1 ;; esac @@ -431,11 +434,24 @@ trap 'exit $?' INT # the test_expect_* functions instead. test_ok_ () { + if test -n "$write_junit_xml" + then + write_junit_xml_testcase "$*" + fi test_success=$(($test_success + 1)) say_color "" "ok $test_count - $@" } test_failure_ () { + if test -n "$write_junit_xml" + then + junit_insert="" + junit_insert="$junit_insert $(xml_attr_encode \ + "$(printf '%s\n' "$@" | sed 1d)")" + junit_insert="$junit_insert" + write_junit_xml_testcase "$1" " $junit_insert" + fi test_failure=$(($test_failure + 1)) say_color error "not ok $test_count - $1" shift @@ -444,11 +460,19 @@ test_failure_ () { } test_known_broken_ok_ () { + if test -n "$write_junit_xml" + then + write_junit_xml_testcase "$* (breakage fixed)" + fi test_fixed=$(($test_fixed+1)) say_color error "ok $test_count - $@ # TODO known breakage vanished" } test_known_broken_failure_ () { + if test -n "$write_junit_xml" + then + write_junit_xml_testcase "$* (known breakage)" + fi test_broken=$(($test_broken+1)) say_color warn "not ok $test_count - $@ # TODO known breakage" } @@ -706,6 +730,10 @@ test_start_ () { test_count=$(($test_count+1)) maybe_setup_verbose maybe_setup_valgrind + if test -n "$write_junit_xml" + then + junit_start=$(test-tool date getnanos) + fi } test_finish_ () { @@ -743,6 +771,13 @@ test_skip () { case "$to_skip" in t) + if test -n "$write_junit_xml" + then + message="$(xml_attr_encode "$skipped_reason")" + write_junit_xml_testcase "$1" \ + " " + fi + say_color skip >&3 "skipping test: $@" say_color skip "ok $test_count # skip $1 ($skipped_reason)" : true @@ -758,9 +793,58 @@ test_at_end_hook_ () { : } +write_junit_xml () { + case "$1" in + --truncate) + >"$junit_xml_path" + junit_have_testcase= + shift + ;; + esac + printf '%s\n' "$@" >>"$junit_xml_path" +} + +xml_attr_encode () { + # We do not translate CR to because BSD sed does not handle + # \r in the regex. In practice, the output should not even have any + # carriage returns. + printf '%s\n' "$@" | + sed -e 's/&/\&/g' -e "s/'/\'/g" -e 's/"/\"/g' \ + -e 's//\>/g' \ + -e 's/ /\ /g' -e 's/$/\ /' -e '$s/ $//' | + tr -d '\012\015' +} + +write_junit_xml_testcase () { + junit_attrs="name=\"$(xml_attr_encode "$this_test.$test_count $1")\"" + shift + junit_attrs="$junit_attrs classname=\"$this_test\"" + junit_attrs="$junit_attrs time=\"$(test-tool \ + date getnanos $junit_start)\"" + write_junit_xml "$(printf '%s\n' \ + " " "$@" " ")" + junit_have_testcase=t +} + test_done () { GIT_EXIT_OK=t + if test -n "$write_junit_xml" && test -n "$junit_xml_path" + then + test -n "$junit_have_testcase" || { + junit_start=$(test-tool date getnanos) + write_junit_xml_testcase "all tests skipped" + } + + # adjust the overall time + junit_time=$(test-tool date getnanos $junit_suite_start) + sed "s/]*/& time=\"$junit_time\"/" \ + <"$junit_xml_path" >"$junit_xml_path.new" + mv "$junit_xml_path.new" "$junit_xml_path" + + write_junit_xml " " "" + fi + if test -z "$HARNESS_ACTIVE" then test_results_dir="$TEST_OUTPUT_DIRECTORY/test-results" @@ -996,6 +1080,7 @@ then else mkdir -p "$TRASH_DIRECTORY" fi + # Use -P to resolve symlinks in our working directory so that the cwd # in subprocesses like git equals our $PWD (for pathname comparisons). cd -P "$TRASH_DIRECTORY" || exit 1 @@ -1009,6 +1094,19 @@ then test_done fi +if test -n "$write_junit_xml" +then + junit_xml_dir="$TEST_OUTPUT_DIRECTORY/out" + mkdir -p "$junit_xml_dir" + junit_xml_base=${0##*/} + junit_xml_path="$junit_xml_dir/TEST-${junit_xml_base%.sh}.xml" + junit_attrs="name=\"${junit_xml_base%.sh}\"" + junit_attrs="$junit_attrs timestamp=\"$(TZ=UTC \ + date +%Y-%m-%dT%H:%M:%S)\"" + write_junit_xml --truncate "" " " + junit_suite_start=$(test-tool date getnanos) +fi + # Provide an implementation of the 'yes' utility yes () { if test $# = 0 From patchwork Mon Oct 15 10:12:05 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Arver via GitGitGadget X-Patchwork-Id: 10641495 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 67B2515E2 for ; Mon, 15 Oct 2018 10:12:09 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 566DD29270 for ; Mon, 15 Oct 2018 10:12:09 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4ACA32942E; Mon, 15 Oct 2018 10:12:09 +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 3E0132941A for ; Mon, 15 Oct 2018 10:12:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726687AbeJOR4l (ORCPT ); Mon, 15 Oct 2018 13:56:41 -0400 Received: from mail-pg1-f175.google.com ([209.85.215.175]:40107 "EHLO mail-pg1-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726515AbeJOR4l (ORCPT ); Mon, 15 Oct 2018 13:56:41 -0400 Received: by mail-pg1-f175.google.com with SMTP id n31-v6so8936909pgm.7 for ; Mon, 15 Oct 2018 03:12:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:message-id:in-reply-to:references:from:subject:fcc :content-transfer-encoding:mime-version:to:cc; bh=JZVxgyN5sZUoXAxIQHhjlagC+s+gaWu0xi40fYlv55g=; b=KQYzVVo1ZT4TEH0LIIcKwCtWTDnBSSRxEHE8SY+iAg82x7kDm0SGZeqV1nKRFqQDNg x8IfMGE+fvU84YqlP/oGxi0J2oigrOHhoUKUSReiw3AELjDdYi8Obeej5Q6bGIlthqtr F+U2NjT6wSo/tWNAnjPFSavGfuLNfSgMCcqgQyGmnqhXSnIPiKOF9FOAIjRhxkjlb64/ KtI+zCKcefKTkYjF+A8TE/B0aEzNgkXufsYi7zFhHi5nYQ5kEemLM4BIac3GoSWqfdZy fzpiRM/LIMX8mhSJ+BtvaZA/A30nzS4GRz/DanU+90XeHNkTD29Z3oq2TiT4G7+A7rnt mstA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:message-id:in-reply-to:references:from :subject:fcc:content-transfer-encoding:mime-version:to:cc; bh=JZVxgyN5sZUoXAxIQHhjlagC+s+gaWu0xi40fYlv55g=; b=dJ3sh6KILoDeL4Wt5kNwJXchFbCJQeS/+bYoAbaBGJNsdCWF15ZCo8c2aEBbQDwFr2 0hTueoMLYzs2bSt2LWD6jXbSIMgg5XGzb539kKPr4K8ICjQRqK+M2ooArV0n/z/rNPGV M307N6KREzoYdTYB9fwRYAVdJkl658ixvpfXRF3+Lb5dX778+3DdyPz51qyllBQD5RZ6 a02GvRNsmg70mhpSKaBFnBITfZpNS0ksvb3s8BpYIz/betMNY5t6J8Ok/uT/IwFlDyIB 2NDioj5Qb7U+RZEly5qkCkq9j0Iv/2nUXjfngF9WWyrDIw0IVu/x7APAfgE2u5ydQOrC kV5A== X-Gm-Message-State: ABuFfohTm/+JuM3zNvJQmJGHpg+Zzc5J5IlBUf7GwlXMGqDorY1WYlMW 1mZSAAt6ibhpmAvmgiueeCK4ykmz X-Google-Smtp-Source: ACcGV63mMs1IuqjWoL+ZTP5rviJuBfD9RArytL71W3hgmEmAkX9QYUAkTNIfV4npRtN8xsIWey9UOg== X-Received: by 2002:a63:1411:: with SMTP id u17-v6mr15185679pgl.247.1539598326259; Mon, 15 Oct 2018 03:12:06 -0700 (PDT) Received: from [127.0.0.1] ([40.112.137.127]) by smtp.gmail.com with ESMTPSA id v84-v6sm14856242pfk.12.2018.10.15.03.12.05 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 15 Oct 2018 03:12:05 -0700 (PDT) Date: Mon, 15 Oct 2018 03:12:05 -0700 (PDT) X-Google-Original-Date: Mon, 15 Oct 2018 10:11:47 GMT Message-Id: <486d1d25183fc7b0de599a0791ed41a87cc176cb.1539598316.git.gitgitgadget@gmail.com> In-Reply-To: References: From: "Johannes Schindelin via GitGitGadget" Subject: [PATCH v2 05/13] ci/lib.sh: add support for Azure Pipelines Fcc: Sent MIME-Version: 1.0 To: git@vger.kernel.org Cc: Junio C Hamano , Johannes Schindelin Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Johannes Schindelin This patch introduces a conditional arm that defines some environment variables and a function that displays the URL given the job id (to identify previous runs for known-good trees). Signed-off-by: Johannes Schindelin --- ci/lib.sh | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/ci/lib.sh b/ci/lib.sh index 8532555b4e..584abcd529 100755 --- a/ci/lib.sh +++ b/ci/lib.sh @@ -19,6 +19,29 @@ then BREW_INSTALL_PACKAGES="git-lfs gettext" export GIT_PROVE_OPTS="--timer --jobs 3 --state=failed,slow,save" export GIT_TEST_OPTS="--verbose-log -x --immediate" +elif test -n "$SYSTEM_TASKDEFINITIONSURI" +then + # We are running in Azure Pipelines + CI_BRANCH="$BUILD_SOURCEBRANCH" + 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 + # among *all* phases) + cache_dir="$HOME/test-cache/$SYSTEM_PHASENAME" + + url_for_job_id () { + echo "$SYSTEM_TASKDEFINITIONSURI$SYSTEM_TEAMPROJECT/_build/results?buildId=$1" + } + + BREW_INSTALL_PACKAGES= + export GIT_PROVE_OPTS="--timer --jobs 10 --state=failed,slow,save" + export GIT_TEST_OPTS="--quiet --write-junit-xml" fi skip_branch_tip_with_tag () { From patchwork Mon Oct 15 10:12:06 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Arver via GitGitGadget X-Patchwork-Id: 10641499 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 7D0291057 for ; Mon, 15 Oct 2018 10:12:11 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6983428C82 for ; Mon, 15 Oct 2018 10:12:11 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5AC262941A; Mon, 15 Oct 2018 10:12:11 +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 2A37228C82 for ; Mon, 15 Oct 2018 10:12:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726765AbeJOR4n (ORCPT ); Mon, 15 Oct 2018 13:56:43 -0400 Received: from mail-pg1-f196.google.com ([209.85.215.196]:35119 "EHLO mail-pg1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726515AbeJOR4n (ORCPT ); Mon, 15 Oct 2018 13:56:43 -0400 Received: by mail-pg1-f196.google.com with SMTP id v133-v6so8946114pgb.2 for ; Mon, 15 Oct 2018 03:12:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:message-id:in-reply-to:references:from:subject:fcc :content-transfer-encoding:mime-version:to:cc; bh=m+Q5LWWbECpKHe2DgxjH7XinVp7qDLxZn6Hxn62fG+8=; b=jLQvwKdoiQYnOWnqN4KSrHYwt+XHKPLEDBrMPTmpqzOdCxIYFWwBX7BMCMm2Q+ZjgX uxi+YnbTezTbwiFe1VzzJf8yRxqKV4V4PZ63JPxW5bYdyUmDj8fjr99uuO80YAxRe2kC DsZCe5DCWlyKK83E50XTYTd6lIYMh8+eWvXuKTSWJz/eEsMsAh6eSHzjWcNbliDcHuVc UWpoWmicTiTAmRNwMp10kfGOghigJS8DPbteNTJh1J9Ji1TiT/MFlPAeBx0yxsk+9PT8 vxfTIwUUkl3/r3n+FXJs1u6gi9qOQFTUSUwpPx8/0FNeMzLqAy1sLVz9vHYLwBvGHUSX dYlw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:message-id:in-reply-to:references:from :subject:fcc:content-transfer-encoding:mime-version:to:cc; bh=m+Q5LWWbECpKHe2DgxjH7XinVp7qDLxZn6Hxn62fG+8=; b=iB2s8XkwIldU87/4fKxgxbXFrul0CRww0bBU/VLpwEsqhvZtc1Uw4JUkUTlt7GVblf TTTPjhwfGRdjhPJpokXd+MsldjvkAEE2XniSG7YZsIxiERJzbBy5xLYzL5UOt9EyZJ6u 8vL/8k0/2aKtlVOZ+pldd0i6EFoM48KqeCxX+mq4rvuBUtD9rZU1ZGF6m+uXTDTIB4eR 0AUxLFtS5AMhYg2u+jOjxNPeQxesiT+en+Q6+eWtkmA3ktYhDslCokl8lSRfJC6jrcvJ XojObrx/GurlWndTfKNNPFzOlO2vemDjrLfaKEHbaIldwIcdeDTWZp8guTHGWlCIgQtD tLlw== X-Gm-Message-State: ABuFfoiyCLblGW6Ij0wDVqeqVOEhe5zcdsjjm5Lt8eAi3lPiMkUg+RGt 7DY96yEWBUf47SyheMdkWNBo4Cfy X-Google-Smtp-Source: ACcGV61+EC6Pe7TPtHKX4JSui974ISHOhQ9c6CAPeRnnSbK3bKdodwAgVaxfgZP8o8WiyHkB5Nl/Sw== X-Received: by 2002:a62:36c3:: with SMTP id d186-v6mr16553432pfa.133.1539598327643; Mon, 15 Oct 2018 03:12:07 -0700 (PDT) Received: from [127.0.0.1] ([40.112.137.127]) by smtp.gmail.com with ESMTPSA id j25-v6sm11812203pff.116.2018.10.15.03.12.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 15 Oct 2018 03:12:06 -0700 (PDT) Date: Mon, 15 Oct 2018 03:12:06 -0700 (PDT) X-Google-Original-Date: Mon, 15 Oct 2018 10:11:48 GMT Message-Id: <1a22efe849d6da79f2c639c62a1483361a130238.1539598316.git.gitgitgadget@gmail.com> In-Reply-To: References: From: "Johannes Schindelin via GitGitGadget" Subject: [PATCH v2 06/13] Add a build definition for Azure DevOps Fcc: Sent MIME-Version: 1.0 To: git@vger.kernel.org Cc: Junio C Hamano , Johannes Schindelin Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Johannes Schindelin This commit adds an azure-pipelines.yml file which is Azure DevOps' equivalent to Travis CI's .travis.yml. To make things a bit easier to understand, we refrain from using the `matrix` feature here because (while it is powerful) it can be a bit confusing to users who are not familiar with CI setups. Therefore, we use a separate phase even for similar configurations (such as GCC vs Clang on Linux, GCC vs Clang on macOS). Also, we make use of the shiny new feature we just introduced where the test suite can output JUnit-style .xml files. This information is made available in a nice UI that allows the viewer to filter by phase and/or test number, and to see trends such as: number of (failing) tests, time spent running the test suite, etc. Signed-off-by: Johannes Schindelin --- azure-pipelines.yml | 319 ++++++++++++++++++++++++++++++++++++++++++ ci/mount-fileshare.sh | 26 ++++ 2 files changed, 345 insertions(+) create mode 100644 azure-pipelines.yml create mode 100755 ci/mount-fileshare.sh diff --git a/azure-pipelines.yml b/azure-pipelines.yml new file mode 100644 index 0000000000..b5749121d2 --- /dev/null +++ b/azure-pipelines.yml @@ -0,0 +1,319 @@ +resources: +- repo: self + fetchDepth: 1 + +phases: +- phase: linux_clang + displayName: linux-clang + condition: succeeded() + queue: + name: Hosted Ubuntu 1604 + steps: + - bash: | + test "$GITFILESHAREPWD" = '$(gitfileshare.pwd)' || ci/mount-fileshare.sh //gitfileshare.file.core.windows.net/test-cache gitfileshare "$GITFILESHAREPWD" "$HOME/test-cache" || exit 1 + + sudo apt-get update && + sudo apt-get -y install git gcc make libssl-dev libcurl4-openssl-dev libexpat-dev tcl tk gettext git-email zlib1g-dev apache2-bin && + + export CC=clang || exit 1 + + ci/install-dependencies.sh + ci/run-build-and-tests.sh || { + ci/print-test-failures.sh + exit 1 + } + + test "$GITFILESHAREPWD" = '$(gitfileshare.pwd)' || sudo umount "$HOME/test-cache" || exit 1 + displayName: 'ci/run-build-and-tests.sh' + env: + GITFILESHAREPWD: $(gitfileshare.pwd) + - task: PublishTestResults@2 + displayName: 'Publish Test Results **/TEST-*.xml' + inputs: + mergeTestResults: true + testRunTitle: 'linux-clang' + platform: Linux + publishRunAttachments: false + condition: succeededOrFailed() + +- phase: linux_gcc + displayName: linux-gcc + condition: succeeded() + queue: + name: Hosted Ubuntu 1604 + steps: + - bash: | + test "$GITFILESHAREPWD" = '$(gitfileshare.pwd)' || ci/mount-fileshare.sh //gitfileshare.file.core.windows.net/test-cache gitfileshare "$GITFILESHAREPWD" "$HOME/test-cache" || exit 1 + + sudo apt-get update && + sudo apt-get -y install git gcc make libssl-dev libcurl4-openssl-dev libexpat-dev tcl tk gettext git-email zlib1g-dev apache2-bin || exit 1 + + ci/install-dependencies.sh + ci/run-build-and-tests.sh || { + ci/print-test-failures.sh + exit 1 + } + + test "$GITFILESHAREPWD" = '$(gitfileshare.pwd)' || sudo umount "$HOME/test-cache" || exit 1 + displayName: 'ci/run-build-and-tests.sh' + env: + GITFILESHAREPWD: $(gitfileshare.pwd) + - task: PublishTestResults@2 + displayName: 'Publish Test Results **/TEST-*.xml' + inputs: + mergeTestResults: true + testRunTitle: 'linux-gcc' + platform: Linux + publishRunAttachments: false + condition: succeededOrFailed() + +- phase: osx_clang + displayName: osx-clang + condition: succeeded() + queue: + name: Hosted macOS + steps: + - bash: | + test "$GITFILESHAREPWD" = '$(gitfileshare.pwd)' || ci/mount-fileshare.sh //gitfileshare.file.core.windows.net/test-cache gitfileshare "$GITFILESHAREPWD" "$HOME/test-cache" || exit 1 + + export CC=clang + + ci/install-dependencies.sh + ci/run-build-and-tests.sh || { + ci/print-test-failures.sh + exit 1 + } + + test "$GITFILESHAREPWD" = '$(gitfileshare.pwd)' || umount "$HOME/test-cache" || exit 1 + displayName: 'ci/run-build-and-tests.sh' + env: + GITFILESHAREPWD: $(gitfileshare.pwd) + - task: PublishTestResults@2 + displayName: 'Publish Test Results **/TEST-*.xml' + inputs: + mergeTestResults: true + testRunTitle: 'osx-clang' + platform: macOS + publishRunAttachments: false + condition: succeededOrFailed() + +- phase: osx_gcc + displayName: osx-gcc + condition: succeeded() + queue: + name: Hosted macOS + steps: + - bash: | + test "$GITFILESHAREPWD" = '$(gitfileshare.pwd)' || ci/mount-fileshare.sh //gitfileshare.file.core.windows.net/test-cache gitfileshare "$GITFILESHAREPWD" "$HOME/test-cache" || exit 1 + + ci/install-dependencies.sh + ci/run-build-and-tests.sh || { + ci/print-test-failures.sh + exit 1 + } + + test "$GITFILESHAREPWD" = '$(gitfileshare.pwd)' || umount "$HOME/test-cache" || exit 1 + displayName: 'ci/run-build-and-tests.sh' + env: + GITFILESHAREPWD: $(gitfileshare.pwd) + - task: PublishTestResults@2 + displayName: 'Publish Test Results **/TEST-*.xml' + inputs: + mergeTestResults: true + testRunTitle: 'osx-gcc' + platform: macOS + publishRunAttachments: false + condition: succeededOrFailed() + +- phase: gettext_poison + displayName: GETTEXT_POISON + condition: succeeded() + queue: + name: Hosted Ubuntu 1604 + steps: + - bash: | + test "$GITFILESHAREPWD" = '$(gitfileshare.pwd)' || ci/mount-fileshare.sh //gitfileshare.file.core.windows.net/test-cache gitfileshare "$GITFILESHAREPWD" "$HOME/test-cache" || exit 1 + + sudo apt-get update && + sudo apt-get -y install git gcc make libssl-dev libcurl4-openssl-dev libexpat-dev tcl tk gettext git-email zlib1g-dev && + + export jobname=GETTEXT_POISON || exit 1 + + ci/run-build-and-tests.sh || { + ci/print-test-failures.sh + exit 1 + } + + test "$GITFILESHAREPWD" = '$(gitfileshare.pwd)' || sudo umount "$HOME/test-cache" || exit 1 + displayName: 'ci/run-build-and-tests.sh' + env: + GITFILESHAREPWD: $(gitfileshare.pwd) + - task: PublishTestResults@2 + displayName: 'Publish Test Results **/TEST-*.xml' + inputs: + mergeTestResults: true + testRunTitle: 'gettext-poison' + platform: Linux + publishRunAttachments: false + condition: succeededOrFailed() + +- phase: windows + displayName: Windows + condition: succeeded() + queue: + name: Hosted VS2017 + timeoutInMinutes: 240 + steps: + - powershell: | + # Helper to check the error level of the latest command (exit with error when appropriate) + function c() { if (!$?) { exit(1) } } + + if ("$GITFILESHAREPWD" -ne "" -and "$GITFILESHAREPWD" -ne "`$`(gitfileshare.pwd)") { + net use s: \\gitfileshare.file.core.windows.net\test-cache "$GITFILESHAREPWD" /user:AZURE\gitfileshare /persistent:no; c + cmd /c mklink /d "$(Build.SourcesDirectory)\test-cache" S:\; c + } + + # Add build agent's MinGit to PATH + $env:PATH = $env:AGENT_HOMEDIRECTORY +"\externals\\git\cmd;" +$env:PATH + + # Helper to initialize (or update) a Git worktree + function init ($path, $url, $set_origin) { + if (Test-Path $path) { + cd $path; c + if (Test-Path .git) { + git init; c + } else { + git status + } + } else { + git init $path; c + cd $path; c + } + git config core.autocrlf false; c + git config core.untrackedCache true; c + if (($set_origin -ne 0) -and !(git config remote.origin.url)) { + git remote add origin $url; c + } + git fetch --depth=1 $url master; c + git reset --hard FETCH_HEAD; c + git clean -df; c + } + + # Initialize Git for Windows' SDK + $sdk_path = "$(Build.SourcesDirectory)\git-sdk-64" + init "$sdk_path" "https://dev.azure.com/git-for-windows/git-sdk-64/_git/git-sdk-64" 0 + init usr\src\build-extra https://github.com/git-for-windows/build-extra 1 + + cd "$(Build.SourcesDirectory)"; c + + $env:HOME = "$(Build.SourcesDirectory)" + $env:MSYSTEM = "MINGW64" + git-sdk-64\git-cmd --command=usr\\bin\\bash.exe -lc @" + . ci/lib.sh + + make -j10 DEVELOPER=1 NO_PERL=1 || exit 1 + NO_PERL=1 NO_SVN_TESTS=1 GIT_TEST_OPTS=\"--quiet --write-junit-xml\" time make -j15 -k DEVELOPER=1 test || { + NO_PERL=1 NO_SVN_TESTS=1 GIT_TEST_OPTS=\"-i -v -x\" make -k -C t failed; exit 1 + } + + save_good_tree + "@ + c + + if ("$GITFILESHAREPWD" -ne "" -and "$GITFILESHAREPWD" -ne "`$`(gitfileshare.pwd)") { + cmd /c rmdir "$(Build.SourcesDirectory)\test-cache" + } + displayName: 'build & test' + env: + GITFILESHAREPWD: $(gitfileshare.pwd) + - task: PublishTestResults@2 + displayName: 'Publish Test Results **/TEST-*.xml' + inputs: + mergeTestResults: true + testRunTitle: 'windows' + platform: Windows + publishRunAttachments: false + condition: succeededOrFailed() + +- phase: linux32 + displayName: Linux32 + condition: succeeded() + queue: + name: Hosted Ubuntu 1604 + steps: + - bash: | + test "$GITFILESHAREPWD" = '$(gitfileshare.pwd)' || ci/mount-fileshare.sh //gitfileshare.file.core.windows.net/test-cache gitfileshare "$GITFILESHAREPWD" "$HOME/test-cache" || exit 1 + + sudo apt-get update && + sudo apt-get -y install \ + apt-transport-https \ + ca-certificates \ + curl \ + software-properties-common && + curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - && + sudo add-apt-repository \ + "deb [arch=amd64] https://download.docker.com/linux/ubuntu \ + $(lsb_release -cs) \ + stable" && + sudo apt-get update && + sudo apt-get -y install docker-ce && + + sudo AGENT_OS="$AGENT_OS" BUILD_BUILDNUMBER="$BUILD_BUILDNUMBER" BUILD_REPOSITORY_URI="$BUILD_REPOSITORY_URI" BUILD_SOURCEBRANCH="$BUILD_SOURCEBRANCH" BUILD_SOURCEVERSION="$BUILD_SOURCEVERSION" SYSTEM_PHASENAME="$SYSTEM_PHASENAME" SYSTEM_TASKDEFINITIONSURI="$SYSTEM_TASKDEFINITIONSURI" SYSTEM_TEAMPROJECT="$SYSTEM_TEAMPROJECT" CC=$CC MAKEFLAGS=-j3 bash -lxc ci/run-linux32-docker.sh || exit 1 + + sudo chmod a+r t/out/TEST-*.xml + + test "$GITFILESHAREPWD" = '$(gitfileshare.pwd)' || sudo umount "$HOME/test-cache" || exit 1 + displayName: 'ci/run-linux32-docker.sh' + env: + GITFILESHAREPWD: $(gitfileshare.pwd) + - task: PublishTestResults@2 + displayName: 'Publish Test Results **/TEST-*.xml' + inputs: + mergeTestResults: true + testRunTitle: 'linux32' + platform: Linux + publishRunAttachments: false + condition: succeededOrFailed() + +- phase: static_analysis + displayName: StaticAnalysis + condition: succeeded() + queue: + name: Hosted Ubuntu 1604 + steps: + - bash: | + test "$GITFILESHAREPWD" = '$(gitfileshare.pwd)' || ci/mount-fileshare.sh //gitfileshare.file.core.windows.net/test-cache gitfileshare "$GITFILESHAREPWD" "$HOME/test-cache" || exit 1 + + sudo apt-get update && + sudo apt-get install -y coccinelle && + + export jobname=StaticAnalysis && + + ci/run-static-analysis.sh || exit 1 + + test "$GITFILESHAREPWD" = '$(gitfileshare.pwd)' || sudo umount "$HOME/test-cache" || exit 1 + displayName: 'ci/run-static-analysis.sh' + env: + GITFILESHAREPWD: $(gitfileshare.pwd) + +- phase: documentation + displayName: Documentation + condition: succeeded() + queue: + name: Hosted Ubuntu 1604 + steps: + - bash: | + test "$GITFILESHAREPWD" = '$(gitfileshare.pwd)' || ci/mount-fileshare.sh //gitfileshare.file.core.windows.net/test-cache gitfileshare "$GITFILESHAREPWD" "$HOME/test-cache" || exit 1 + + sudo apt-get update && + sudo apt-get install -y asciidoc xmlto asciidoctor && + + export ALREADY_HAVE_ASCIIDOCTOR=yes. && + export jobname=Documentation && + + ci/test-documentation.sh || exit 1 + + test "$GITFILESHAREPWD" = '$(gitfileshare.pwd)' || sudo umount "$HOME/test-cache" || exit 1 + displayName: 'ci/test-documentation.sh' + env: + GITFILESHAREPWD: $(gitfileshare.pwd) diff --git a/ci/mount-fileshare.sh b/ci/mount-fileshare.sh new file mode 100755 index 0000000000..5fb5f74b70 --- /dev/null +++ b/ci/mount-fileshare.sh @@ -0,0 +1,26 @@ +#!/bin/sh + +die () { + echo "$*" >&2 + exit 1 +} + +test $# = 4 || +die "Usage: $0 X-Patchwork-Id: 10641501 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 6006E1057 for ; Mon, 15 Oct 2018 10:12:12 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4D68C28C82 for ; Mon, 15 Oct 2018 10:12:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 41B0D2941A; Mon, 15 Oct 2018 10:12:12 +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 C89E828C82 for ; Mon, 15 Oct 2018 10:12:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726779AbeJOR4p (ORCPT ); Mon, 15 Oct 2018 13:56:45 -0400 Received: from mail-pg1-f196.google.com ([209.85.215.196]:32846 "EHLO mail-pg1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726515AbeJOR4o (ORCPT ); Mon, 15 Oct 2018 13:56:44 -0400 Received: by mail-pg1-f196.google.com with SMTP id y18-v6so8957519pge.0 for ; Mon, 15 Oct 2018 03:12:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:message-id:in-reply-to:references:from:subject:fcc :content-transfer-encoding:mime-version:to:cc; bh=yFkau5tDO8LmM1081q0gbLHr4nrIvvPiu6EaqDQgqgI=; b=Cfa+RVJD5QJWjiGKimNWCmzRDBcqvcnWV+9oU+ZDR31LPNZ3cMqx2irtasf/8GBM/T FGBtXyb8qae8IMAetsijX2kr68Mt675Vk/EpKqUthvh8BeZfzY1hvjwDwpplMY26urGk /EhBYmRGNhGwdlJ0e70nPmKGoul+ttBEcJWvwk3Zax6lwDC3iQ1F93K6mIafJcxeBVQT i7MNUEN8G4a2r0eeZWFE/OscQUSaEqAm/adXFYXz0DcZQQBESDhyb9o8lrF12SYc3naQ 5kKysrkOLkcDVv23eD6tTkeaB7c+PXNKLKp+u4TnO067NBNj9aX8LCA//j7/y8XK+dni O/+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:message-id:in-reply-to:references:from :subject:fcc:content-transfer-encoding:mime-version:to:cc; bh=yFkau5tDO8LmM1081q0gbLHr4nrIvvPiu6EaqDQgqgI=; b=HPZvUS+kyvM/0nwRfiV7n+Q6Y9hD6o/Aw4jjFbRfFDjMmcloBBr1TYH0gTx7N5i1ab y1p/VTCPV6xwqThrWKzQlAkcoLpCqEqiUYg6yCrwVdPJsp2t72m8hQVZixpdvLuzwdLf TfooL1zcHP8VUlrM0jTz/0OYxwb3m/bAv+SHsvHv4mYYdOMsPJT19tqW400OPl2yNqhE DamTCqR+gxS7Q8dk0NdjoB2J2Rbq3VZAU0TuDHWRy0YknWIegmDeUNaB8K/Ide2920pl Oq5Q9hAzy9cLMGm0Walp4iSqPT0XpxJCwFf7DNGcieKn0gOTyqKChTU+rsYbzLLYaY6h 72vA== X-Gm-Message-State: ABuFfoj2VQ/EX8k/WZTqlzbciEq41bPDxU2iS07h9m1m2Cc0db+l8B4K 40m+pCHiGbeYuyXGjlniffwE8nVf X-Google-Smtp-Source: ACcGV60x5WdD6YLnZqGGc2gA8kiBPl45AAvHLXbCkOU5+SX3rJuAgLY2F0k7f0xSw9BZzxxVOvwhhw== X-Received: by 2002:a63:680a:: with SMTP id d10-v6mr15301433pgc.7.1539598329248; Mon, 15 Oct 2018 03:12:09 -0700 (PDT) Received: from [127.0.0.1] ([40.112.137.127]) by smtp.gmail.com with ESMTPSA id j64-v6sm11556849pge.15.2018.10.15.03.12.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 15 Oct 2018 03:12:08 -0700 (PDT) Date: Mon, 15 Oct 2018 03:12:08 -0700 (PDT) X-Google-Original-Date: Mon, 15 Oct 2018 10:11:49 GMT Message-Id: <12d6137f8d2ccc2041bed8d56d88a09b1db0fd77.1539598316.git.gitgitgadget@gmail.com> In-Reply-To: References: From: "Johannes Schindelin via GitGitGadget" Subject: [PATCH v2 07/13] tests: introduce `test_atexit` Fcc: Sent MIME-Version: 1.0 To: git@vger.kernel.org Cc: Junio C Hamano , Johannes Schindelin Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Johannes Schindelin When running the p4 daemon or `git daemon`, we want to kill it at the end of the test script. So far, we do this "manually". However, in the next few commits we want to teach the test suite to optionally re-run scripts with different options, therefore we will have to have a consistent way to stop daemons. Let's introduce `test_atexit`, which is loosely modeled after `test_when_finished` (but has a broader scope: rather than running the commands after the current test case, run them when the test script finishes, and also run them when the `--immediate` option is in effect). Signed-off-by: Johannes Schindelin --- t/t0000-basic.sh | 18 ++++++++++++++++++ t/test-lib-functions.sh | 29 +++++++++++++++++++++++++++++ t/test-lib.sh | 4 ++++ 3 files changed, 51 insertions(+) diff --git a/t/t0000-basic.sh b/t/t0000-basic.sh index 391f910c6a..8c5faa6ce1 100755 --- a/t/t0000-basic.sh +++ b/t/t0000-basic.sh @@ -821,6 +821,24 @@ test_expect_success 'tests clean up even on failures' " EOF " +test_expect_success 'test_atexit is run' " + test_must_fail run_sub_test_lib_test \ + atexit-cleanup 'Run atexit commands' -i <<-\\EOF && + test_expect_success 'tests clean up even after a failure' ' + > ../../clean-atexit && + test_atexit rm ../../clean-atexit && + > ../../also-clean-atexit && + test_atexit rm ../../also-clean-atexit && + > ../../dont-clean-atexit && + (exit 1) + ' + test_done + EOF + test_path_exists dont-clean-atexit && + test_path_is_missing clean-atexit && + test_path_is_missing also-clean-atexit +" + test_expect_success 'test_oid setup' ' test_oid_init ' diff --git a/t/test-lib-functions.sh b/t/test-lib-functions.sh index 78d8c3783b..d7dd0c1be9 100644 --- a/t/test-lib-functions.sh +++ b/t/test-lib-functions.sh @@ -891,6 +891,35 @@ test_when_finished () { } && (exit \"\$eval_ret\"); eval_ret=\$?; $test_cleanup" } +# This function can be used to schedule some commands to be run +# unconditionally at the end of the test script, e.g. to stop a daemon: +# +# test_expect_success 'test git daemon' ' +# git daemon & +# daemon_pid=$! && +# test_atexit "kill $daemon_pid" && +# hello world +# ' + +test_atexit () { + # We cannot detect when we are in a subshell in general, but by + # doing so on Bash is better than nothing (the test will + # silently pass on other shells). + test "${BASH_SUBSHELL-0}" = 0 || + error "bug in test script: test_atexit does nothing in a subshell" + test_atexit_cleanup="{ $* + } && (exit \"\$eval_ret\"); eval_ret=\$?; $test_atexit_cleanup" +} + +test_atexit_handler () { + test : != "$test_atexit_cleanup" || return 0 + + setup_malloc_check + test_eval_ "$test_atexit_cleanup" + test_atexit_cleanup=: + teardown_malloc_check +} + # Most tests can use the created repository, but some may need to create more. # Usage: test_create_repo test_create_repo () { diff --git a/t/test-lib.sh b/t/test-lib.sh index 7ed0013f6d..6f9c1f5300 100644 --- a/t/test-lib.sh +++ b/t/test-lib.sh @@ -413,6 +413,7 @@ test_external_has_tap=0 die () { code=$? + test_atexit_handler || code=$? if test -n "$GIT_EXIT_OK" then exit $code @@ -826,9 +827,12 @@ write_junit_xml_testcase () { junit_have_testcase=t } +test_atexit_cleanup=: test_done () { GIT_EXIT_OK=t + test -n "$immediate" || test_atexit_handler + if test -n "$write_junit_xml" && test -n "$junit_xml_path" then test -n "$junit_have_testcase" || { From patchwork Mon Oct 15 10:12:09 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Arver via GitGitGadget X-Patchwork-Id: 10641503 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 B0B37157A for ; Mon, 15 Oct 2018 10:12:13 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9F70B28C82 for ; Mon, 15 Oct 2018 10:12:13 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 93F842941A; Mon, 15 Oct 2018 10:12:13 +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 2E02C28C82 for ; Mon, 15 Oct 2018 10:12:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726810AbeJOR4q (ORCPT ); Mon, 15 Oct 2018 13:56:46 -0400 Received: from mail-pg1-f193.google.com ([209.85.215.193]:42756 "EHLO mail-pg1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726515AbeJOR4q (ORCPT ); Mon, 15 Oct 2018 13:56:46 -0400 Received: by mail-pg1-f193.google.com with SMTP id i4-v6so8932000pgq.9 for ; Mon, 15 Oct 2018 03:12:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:message-id:in-reply-to:references:from:subject:fcc :content-transfer-encoding:mime-version:to:cc; bh=3ULs1ExeZNOpvCCMKWrTYD+uW61BtcLr0jCSXVcolVU=; b=ph79/+aUXoeJD/U3EBxUVrLC8vBNT2HtVp9wU5GJTk157sLAxgzgIxP1/HXgfuYuFh CB6ozoitC02X2fC+thM36Hu5+iUPEd+6lOOLCe8NLsq051od0WQVzj2NzBLQNJTvdGti GraeizmUD/ftJL/oNEbD++WnqzvC+cM53cL+35ZDlK9qUx2lb4TmDaFDy/Dmxclyhaie Gyc6SeQmO3rg4PIyz40XFjBtajJ9C92dvcw/9tvhrXrgaYDTBlg59TLE//71o7Ac2usw Xanhvt5PKoL/C44uihz+A4cOpIRgKLQrwVKjwt1kF3TiWk28EDLn41aMCZG84VoVfA0H KMwA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:message-id:in-reply-to:references:from :subject:fcc:content-transfer-encoding:mime-version:to:cc; bh=3ULs1ExeZNOpvCCMKWrTYD+uW61BtcLr0jCSXVcolVU=; b=F3CNRb/417hPgLNenaEfKChxAo79uBjZkFFtpI3Sp7zaj4YJD1TN3tE/9BX01e4lTT 4plEx0GW/be9G4zmIb2+ljB10qHZ0MlLKIgHgdN6na8P35g6Jos/vxn8BaYty5xUljuu PHcQnwouIQsOfw0wFBdjYgu57+JylQkcsIEL9O7AYRmohTTfs7ghsUrrItON5oFlsYDu /OuhYvnv6WlKs9otAdOmiipaavcAUg2nUzwjx/6mpFWdhBEVYqu4ylon+bNluzYRMjwU GVUhePRvz1xSfWQL8jj72KzOSadMJ0boERYYwCRXtHbzbzfQrXAFMEKMuYXgJuWjNJJq 7UHQ== X-Gm-Message-State: ABuFfoiRsq1y7vNhEYyVy2ko+rLx+1YJfKE5Xh1pgg1vofmC2aTcj84K eKgOcaz6AcBnzgDRR238uwkc4hby X-Google-Smtp-Source: ACcGV60nWv4DSks/JsQXJ1IMNla9bK0bknZpaEZ6SagMTEw8HkTTaJa1t+6CJzowH9Ymk3HkMqblyA== X-Received: by 2002:a63:4047:: with SMTP id n68-v6mr14968717pga.224.1539598330620; Mon, 15 Oct 2018 03:12:10 -0700 (PDT) Received: from [127.0.0.1] ([40.112.137.127]) by smtp.gmail.com with ESMTPSA id n63-v6sm12788928pfn.9.2018.10.15.03.12.09 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 15 Oct 2018 03:12:09 -0700 (PDT) Date: Mon, 15 Oct 2018 03:12:09 -0700 (PDT) X-Google-Original-Date: Mon, 15 Oct 2018 10:11:50 GMT Message-Id: <3bb226b79b87e30a3e8f6360c7f94d9adf4fe1b7.1539598316.git.gitgitgadget@gmail.com> In-Reply-To: References: From: "Johannes Schindelin via GitGitGadget" Subject: [PATCH v2 08/13] git-daemon: use `test_atexit` in the tests Fcc: Sent MIME-Version: 1.0 To: git@vger.kernel.org Cc: Junio C Hamano , Johannes Schindelin Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Johannes Schindelin This makes use of the just-introduced consistent way to specify that a long-running process needs to be terminated at the end of a test script run. Signed-off-by: Johannes Schindelin --- t/interop/i5500-git-daemon.sh | 1 - t/lib-git-daemon.sh | 3 +-- t/t5570-git-daemon.sh | 1 - 3 files changed, 1 insertion(+), 4 deletions(-) diff --git a/t/interop/i5500-git-daemon.sh b/t/interop/i5500-git-daemon.sh index 1daf69420b..4d22e42f84 100755 --- a/t/interop/i5500-git-daemon.sh +++ b/t/interop/i5500-git-daemon.sh @@ -37,5 +37,4 @@ test_expect_success "fetch with $VERSION_B" ' test_cmp expect actual ' -stop_git_daemon test_done diff --git a/t/lib-git-daemon.sh b/t/lib-git-daemon.sh index edbea2d986..a896af2284 100644 --- a/t/lib-git-daemon.sh +++ b/t/lib-git-daemon.sh @@ -13,7 +13,6 @@ # # test_expect_success ... # -# stop_git_daemon # test_done test_tristate GIT_TEST_GIT_DAEMON @@ -43,7 +42,7 @@ start_git_daemon() { mkdir -p "$GIT_DAEMON_DOCUMENT_ROOT_PATH" - trap 'code=$?; stop_git_daemon; (exit $code); die' EXIT + test_atexit 'stop_git_daemon' say >&3 "Starting git daemon ..." mkfifo git_daemon_output diff --git a/t/t5570-git-daemon.sh b/t/t5570-git-daemon.sh index 7466aad111..08f95c80a2 100755 --- a/t/t5570-git-daemon.sh +++ b/t/t5570-git-daemon.sh @@ -211,5 +211,4 @@ test_expect_success FAKENC 'hostname interpolation works after LF-stripping' ' test_cmp expect actual ' -stop_git_daemon test_done From patchwork Mon Oct 15 10:12:11 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Arver via GitGitGadget X-Patchwork-Id: 10641505 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 548D8157A for ; Mon, 15 Oct 2018 10:12:16 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3EC4228C82 for ; Mon, 15 Oct 2018 10:12:16 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 331052941A; Mon, 15 Oct 2018 10:12:16 +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 DF98F28C82 for ; Mon, 15 Oct 2018 10:12:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726837AbeJOR4s (ORCPT ); Mon, 15 Oct 2018 13:56:48 -0400 Received: from mail-pg1-f172.google.com ([209.85.215.172]:37983 "EHLO mail-pg1-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726515AbeJOR4r (ORCPT ); Mon, 15 Oct 2018 13:56:47 -0400 Received: by mail-pg1-f172.google.com with SMTP id f8-v6so8938520pgq.5 for ; Mon, 15 Oct 2018 03:12:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:message-id:in-reply-to:references:from:subject:fcc :content-transfer-encoding:mime-version:to:cc; bh=U1OT1hvoHe4viVyjUzQBm3cQ0+6KRjylDuVB5hHCuLs=; b=QJOpMVdE+VbFhzMKwqH2uk6/KZaFT58KUUqWtQlCKk2zTUL99tgInCfumWQcQgNYrY ilzbS8F7GtUklNN1tD+G6N5hTSpxNb2AELhCgm1vxTwbwqimS8BxoBiGuMeWCBI1D0T+ PR/ZD5kP+RvUkvPdK5mxSa7DvPSuLe37ZMGgXQbwWxX/x+aqKBOZBwiBhuVDuo/UQ9Kv +9/2h0tkvOFI4WphcYVlc9OtAVxS10CZs/0V3ZhkZb8xr1jPni7j+USJ2DNw75MpQH1C WVKaOuwuDexbJX099USlTDo1Qylqs90Q5avKZkyHFNZrRxK0ERmWc884E62x8USKwDGt TdZA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:message-id:in-reply-to:references:from :subject:fcc:content-transfer-encoding:mime-version:to:cc; bh=U1OT1hvoHe4viVyjUzQBm3cQ0+6KRjylDuVB5hHCuLs=; b=R9BJ436hZ89j4pPnmB66KVzs7DTqdZ40Xfr+bPPUuFpbsHdaXvOGebFv4zTuQjpdXd fg97fN7pgyoQeuPX8g/OLaOO9ytcFIrNAtzpCaPxXJ6w8IGH0pblYNW+mmzm1rBexR0F EB8tMnYONheezh5TW7XV8agImpC8u+2zhgUHlLhDgeTtBnNBmQDYQKTO28TzwG8hDUtZ U6RyfPwd74FipWJm4p220F7PNqYkC4RUorw8MJtgVUPTVDUqrcqMNP7CjZIvpAEB4mX2 fBayTWZyyL/XlLHkIn8wPKN+bWPnxVJgU9jaGSPh3ZLHKXpg6OhYWN3307PNjm0Lkpxl FFNQ== X-Gm-Message-State: ABuFfoiCUmH+vCMjMmc0NgOWIVoonO3guz052SG8c+IWRJqPxawzNjXT yBp1rQBfQ7Z7ytBVUdKZMlnT9COn X-Google-Smtp-Source: ACcGV61yI2mOFlBXOQeBd2Nc1WSZo8crujLpyX3EvD47Aj76zy/cJC5RaExqgm4xMEThIgrLRVZXFA== X-Received: by 2002:a62:ff09:: with SMTP id b9-v6mr16854462pfn.46.1539598332006; Mon, 15 Oct 2018 03:12:12 -0700 (PDT) Received: from [127.0.0.1] ([40.112.137.127]) by smtp.gmail.com with ESMTPSA id u62-v6sm13499965pfu.69.2018.10.15.03.12.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 15 Oct 2018 03:12:11 -0700 (PDT) Date: Mon, 15 Oct 2018 03:12:11 -0700 (PDT) X-Google-Original-Date: Mon, 15 Oct 2018 10:11:51 GMT Message-Id: <3e2193a73de0b68d5a38f1792642c828f4aed1db.1539598316.git.gitgitgadget@gmail.com> In-Reply-To: References: From: "Johannes Schindelin via GitGitGadget" Subject: [PATCH v2 09/13] git-p4: use `test_atexit` to kill the daemon Fcc: Sent MIME-Version: 1.0 To: git@vger.kernel.org Cc: Junio C Hamano , Johannes Schindelin Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Johannes Schindelin This should be more reliable than the current method, and prepares the test suite for a consistent way to clean up before re-running the tests with different options. Signed-off-by: Johannes Schindelin --- t/lib-git-p4.sh | 10 +--------- t/t0000-basic.sh | 2 ++ t/t9800-git-p4-basic.sh | 4 ---- t/t9801-git-p4-branch.sh | 4 ---- t/t9802-git-p4-filetype.sh | 4 ---- t/t9803-git-p4-shell-metachars.sh | 4 ---- t/t9804-git-p4-label.sh | 4 ---- t/t9805-git-p4-skip-submit-edit.sh | 4 ---- t/t9806-git-p4-options.sh | 5 ----- t/t9807-git-p4-submit.sh | 4 ---- t/t9808-git-p4-chdir.sh | 4 ---- t/t9809-git-p4-client-view.sh | 4 ---- t/t9810-git-p4-rcs.sh | 4 ---- t/t9811-git-p4-label-import.sh | 5 ----- t/t9812-git-p4-wildcards.sh | 4 ---- t/t9813-git-p4-preserve-users.sh | 4 ---- t/t9814-git-p4-rename.sh | 4 ---- t/t9815-git-p4-submit-fail.sh | 4 ---- t/t9816-git-p4-locked.sh | 4 ---- t/t9817-git-p4-exclude.sh | 4 ---- t/t9818-git-p4-block.sh | 4 ---- t/t9819-git-p4-case-folding.sh | 4 ---- t/t9820-git-p4-editor-handling.sh | 4 ---- t/t9821-git-p4-path-variations.sh | 4 ---- t/t9822-git-p4-path-encoding.sh | 4 ---- t/t9823-git-p4-mock-lfs.sh | 4 ---- t/t9824-git-p4-git-lfs.sh | 4 ---- t/t9825-git-p4-handle-utf16-without-bom.sh | 4 ---- t/t9826-git-p4-keep-empty-commits.sh | 4 ---- t/t9827-git-p4-change-filetype.sh | 4 ---- t/t9828-git-p4-map-user.sh | 4 ---- t/t9829-git-p4-jobs.sh | 4 ---- t/t9830-git-p4-symlink-dir.sh | 4 ---- t/t9831-git-p4-triggers.sh | 4 ---- t/t9832-unshelve.sh | 4 ---- t/t9833-errors.sh | 5 ----- 36 files changed, 3 insertions(+), 148 deletions(-) diff --git a/t/lib-git-p4.sh b/t/lib-git-p4.sh index c27599474c..f4f5d7d296 100644 --- a/t/lib-git-p4.sh +++ b/t/lib-git-p4.sh @@ -74,15 +74,6 @@ cli="$TRASH_DIRECTORY/cli" git="$TRASH_DIRECTORY/git" pidfile="$TRASH_DIRECTORY/p4d.pid" -# Sometimes "prove" seems to hang on exit because p4d is still running -cleanup () { - if test -f "$pidfile" - then - kill -9 $(cat "$pidfile") 2>/dev/null && exit 255 - fi -} -trap cleanup EXIT - # git p4 submit generates a temp file, which will # not get cleaned up if the submission fails. Don't # clutter up /tmp on the test machine. @@ -141,6 +132,7 @@ start_p4d () { # p4d failed to start return 1 fi + test_atexit kill_p4d # build a p4 user so author@example.com has an entry p4_add_user author diff --git a/t/t0000-basic.sh b/t/t0000-basic.sh index 8c5faa6ce1..041bd7e3ce 100755 --- a/t/t0000-basic.sh +++ b/t/t0000-basic.sh @@ -134,6 +134,7 @@ check_sub_test_lib_test_err () { ) } +cat >/dev/null <<\DDD test_expect_success 'pretend we have a fully passing test suite' " run_sub_test_lib_test full-pass '3 passing tests' <<-\\EOF && for i in 1 2 3 @@ -820,6 +821,7 @@ test_expect_success 'tests clean up even on failures' " > 1..2 EOF " +DDD test_expect_success 'test_atexit is run' " test_must_fail run_sub_test_lib_test \ diff --git a/t/t9800-git-p4-basic.sh b/t/t9800-git-p4-basic.sh index 729cd25770..5856563068 100755 --- a/t/t9800-git-p4-basic.sh +++ b/t/t9800-git-p4-basic.sh @@ -326,8 +326,4 @@ test_expect_success 'submit from worktree' ' ) ' -test_expect_success 'kill p4d' ' - kill_p4d -' - test_done diff --git a/t/t9801-git-p4-branch.sh b/t/t9801-git-p4-branch.sh index 6a86d6996b..50013132c8 100755 --- a/t/t9801-git-p4-branch.sh +++ b/t/t9801-git-p4-branch.sh @@ -610,8 +610,4 @@ test_expect_success 'Update a file in git side and submit to P4 using client vie ) ' -test_expect_success 'kill p4d' ' - kill_p4d -' - test_done diff --git a/t/t9802-git-p4-filetype.sh b/t/t9802-git-p4-filetype.sh index 9978352d78..94edebe272 100755 --- a/t/t9802-git-p4-filetype.sh +++ b/t/t9802-git-p4-filetype.sh @@ -333,8 +333,4 @@ test_expect_success SYMLINKS 'empty symlink target' ' ) ' -test_expect_success 'kill p4d' ' - kill_p4d -' - test_done diff --git a/t/t9803-git-p4-shell-metachars.sh b/t/t9803-git-p4-shell-metachars.sh index d5c3675100..2913277013 100755 --- a/t/t9803-git-p4-shell-metachars.sh +++ b/t/t9803-git-p4-shell-metachars.sh @@ -105,8 +105,4 @@ test_expect_success 'branch with shell char' ' ) ' -test_expect_success 'kill p4d' ' - kill_p4d -' - test_done diff --git a/t/t9804-git-p4-label.sh b/t/t9804-git-p4-label.sh index e30f80e617..3236457106 100755 --- a/t/t9804-git-p4-label.sh +++ b/t/t9804-git-p4-label.sh @@ -108,8 +108,4 @@ test_expect_failure 'two labels on the same changelist' ' ) ' -test_expect_success 'kill p4d' ' - kill_p4d -' - test_done diff --git a/t/t9805-git-p4-skip-submit-edit.sh b/t/t9805-git-p4-skip-submit-edit.sh index 5fbf904dc8..90ef647db7 100755 --- a/t/t9805-git-p4-skip-submit-edit.sh +++ b/t/t9805-git-p4-skip-submit-edit.sh @@ -98,8 +98,4 @@ test_expect_success 'no config, edited' ' ) ' -test_expect_success 'kill p4d' ' - kill_p4d -' - test_done diff --git a/t/t9806-git-p4-options.sh b/t/t9806-git-p4-options.sh index 3f5291b857..4e794a01bf 100755 --- a/t/t9806-git-p4-options.sh +++ b/t/t9806-git-p4-options.sh @@ -300,9 +300,4 @@ test_expect_success 'use --git-dir option and GIT_DIR' ' test_path_is_file "$git"/cli_file2.t ' - -test_expect_success 'kill p4d' ' - kill_p4d -' - test_done diff --git a/t/t9807-git-p4-submit.sh b/t/t9807-git-p4-submit.sh index 2325599ee6..488d916c10 100755 --- a/t/t9807-git-p4-submit.sh +++ b/t/t9807-git-p4-submit.sh @@ -542,8 +542,4 @@ test_expect_success 'submit --update-shelve' ' ) ' -test_expect_success 'kill p4d' ' - kill_p4d -' - test_done diff --git a/t/t9808-git-p4-chdir.sh b/t/t9808-git-p4-chdir.sh index 11d2b5102c..58a9b3b71e 100755 --- a/t/t9808-git-p4-chdir.sh +++ b/t/t9808-git-p4-chdir.sh @@ -83,8 +83,4 @@ test_expect_success SYMLINKS 'p4 client root symlink should stay symbolic' ' ) ' -test_expect_success 'kill p4d' ' - kill_p4d -' - test_done diff --git a/t/t9809-git-p4-client-view.sh b/t/t9809-git-p4-client-view.sh index 897b3c3034..3cff1fce1b 100755 --- a/t/t9809-git-p4-client-view.sh +++ b/t/t9809-git-p4-client-view.sh @@ -836,8 +836,4 @@ test_expect_success 'quotes on both sides' ' git_verify "cdir 1/file11" "cdir 1/file12" ' -test_expect_success 'kill p4d' ' - kill_p4d -' - test_done diff --git a/t/t9810-git-p4-rcs.sh b/t/t9810-git-p4-rcs.sh index cc53debe19..57b533dc6f 100755 --- a/t/t9810-git-p4-rcs.sh +++ b/t/t9810-git-p4-rcs.sh @@ -360,8 +360,4 @@ test_expect_failure 'Add keywords in git which do not match the default p4 value ) ' -test_expect_success 'kill p4d' ' - kill_p4d -' - test_done diff --git a/t/t9811-git-p4-label-import.sh b/t/t9811-git-p4-label-import.sh index 602b0a5d5c..b70e81c3cd 100755 --- a/t/t9811-git-p4-label-import.sh +++ b/t/t9811-git-p4-label-import.sh @@ -259,9 +259,4 @@ test_expect_success 'importing labels with missing revisions' ' ) ' - -test_expect_success 'kill p4d' ' - kill_p4d -' - test_done diff --git a/t/t9812-git-p4-wildcards.sh b/t/t9812-git-p4-wildcards.sh index 0206771fbb..254a7c2446 100755 --- a/t/t9812-git-p4-wildcards.sh +++ b/t/t9812-git-p4-wildcards.sh @@ -211,8 +211,4 @@ test_expect_success 'wildcard files requiring keyword scrub' ' ) ' -test_expect_success 'kill p4d' ' - kill_p4d -' - test_done diff --git a/t/t9813-git-p4-preserve-users.sh b/t/t9813-git-p4-preserve-users.sh index 783c6ad165..fd018c87a8 100755 --- a/t/t9813-git-p4-preserve-users.sh +++ b/t/t9813-git-p4-preserve-users.sh @@ -138,8 +138,4 @@ test_expect_success 'not preserving user with mixed authorship' ' ) ' -test_expect_success 'kill p4d' ' - kill_p4d -' - test_done diff --git a/t/t9814-git-p4-rename.sh b/t/t9814-git-p4-rename.sh index 60baa06e27..468767cbf4 100755 --- a/t/t9814-git-p4-rename.sh +++ b/t/t9814-git-p4-rename.sh @@ -242,8 +242,4 @@ test_expect_success P4D_HAVE_CONFIGURABLE_RUN_MOVE_ALLOW \ ) ' -test_expect_success 'kill p4d' ' - kill_p4d -' - test_done diff --git a/t/t9815-git-p4-submit-fail.sh b/t/t9815-git-p4-submit-fail.sh index eaf03a6563..9779dc0d11 100755 --- a/t/t9815-git-p4-submit-fail.sh +++ b/t/t9815-git-p4-submit-fail.sh @@ -422,8 +422,4 @@ test_expect_success 'cleanup chmod after submit cancel' ' ) ' -test_expect_success 'kill p4d' ' - kill_p4d -' - test_done diff --git a/t/t9816-git-p4-locked.sh b/t/t9816-git-p4-locked.sh index d048bd33fa..932841003c 100755 --- a/t/t9816-git-p4-locked.sh +++ b/t/t9816-git-p4-locked.sh @@ -138,8 +138,4 @@ test_expect_failure 'move with lock taken' ' ) ' -test_expect_success 'kill p4d' ' - kill_p4d -' - test_done diff --git a/t/t9817-git-p4-exclude.sh b/t/t9817-git-p4-exclude.sh index aac568eadf..96d25f0c02 100755 --- a/t/t9817-git-p4-exclude.sh +++ b/t/t9817-git-p4-exclude.sh @@ -64,8 +64,4 @@ test_expect_success 'clone, then sync with exclude' ' ) ' -test_expect_success 'kill p4d' ' - kill_p4d -' - test_done diff --git a/t/t9818-git-p4-block.sh b/t/t9818-git-p4-block.sh index ce7cb22ad3..0db7ab9918 100755 --- a/t/t9818-git-p4-block.sh +++ b/t/t9818-git-p4-block.sh @@ -146,8 +146,4 @@ test_expect_success 'Clone repo with self-sizing block size' ' test_line_count \> 10 log ' -test_expect_success 'kill p4d' ' - kill_p4d -' - test_done diff --git a/t/t9819-git-p4-case-folding.sh b/t/t9819-git-p4-case-folding.sh index d808c008c1..600ce1e0b0 100755 --- a/t/t9819-git-p4-case-folding.sh +++ b/t/t9819-git-p4-case-folding.sh @@ -53,8 +53,4 @@ test_expect_failure 'Clone UC repo with lc name' ' test_must_fail git p4 clone //depot/uc/... ' -test_expect_success 'kill p4d' ' - kill_p4d -' - test_done diff --git a/t/t9820-git-p4-editor-handling.sh b/t/t9820-git-p4-editor-handling.sh index 3c22f74bd4..fa1bba1dd9 100755 --- a/t/t9820-git-p4-editor-handling.sh +++ b/t/t9820-git-p4-editor-handling.sh @@ -31,8 +31,4 @@ test_expect_success 'EDITOR with options' ' ) ' -test_expect_success 'kill p4d' ' - kill_p4d -' - test_done diff --git a/t/t9821-git-p4-path-variations.sh b/t/t9821-git-p4-path-variations.sh index 81e46acfa8..ef80f1690b 100755 --- a/t/t9821-git-p4-path-variations.sh +++ b/t/t9821-git-p4-path-variations.sh @@ -193,8 +193,4 @@ test_expect_success 'Add a new file and clone path with new file (ignorecase)' ' ) ' -test_expect_success 'kill p4d' ' - kill_p4d -' - test_done diff --git a/t/t9822-git-p4-path-encoding.sh b/t/t9822-git-p4-path-encoding.sh index c78477c19b..1bf7635016 100755 --- a/t/t9822-git-p4-path-encoding.sh +++ b/t/t9822-git-p4-path-encoding.sh @@ -67,8 +67,4 @@ test_expect_success 'Delete iso8859-1 encoded paths and clone' ' ) ' -test_expect_success 'kill p4d' ' - kill_p4d -' - test_done diff --git a/t/t9823-git-p4-mock-lfs.sh b/t/t9823-git-p4-mock-lfs.sh index 1f2dc369bf..88b76dc4d6 100755 --- a/t/t9823-git-p4-mock-lfs.sh +++ b/t/t9823-git-p4-mock-lfs.sh @@ -185,8 +185,4 @@ test_expect_success 'Run git p4 submit in repo configured with large file system ) ' -test_expect_success 'kill p4d' ' - kill_p4d -' - test_done diff --git a/t/t9824-git-p4-git-lfs.sh b/t/t9824-git-p4-git-lfs.sh index ed80ca858c..a28dbbdd56 100755 --- a/t/t9824-git-p4-git-lfs.sh +++ b/t/t9824-git-p4-git-lfs.sh @@ -287,8 +287,4 @@ test_expect_success 'Add big files to repo and store files in LFS based on compr ) ' -test_expect_success 'kill p4d' ' - kill_p4d -' - test_done diff --git a/t/t9825-git-p4-handle-utf16-without-bom.sh b/t/t9825-git-p4-handle-utf16-without-bom.sh index 1551845dc1..f049ff8229 100755 --- a/t/t9825-git-p4-handle-utf16-without-bom.sh +++ b/t/t9825-git-p4-handle-utf16-without-bom.sh @@ -43,8 +43,4 @@ test_expect_failure 'clone depot with invalid UTF-16 file in non-verbose mode' ' git p4 clone --dest="$git" //depot ' -test_expect_success 'kill p4d' ' - kill_p4d -' - test_done diff --git a/t/t9826-git-p4-keep-empty-commits.sh b/t/t9826-git-p4-keep-empty-commits.sh index fa8b9daf1f..fd64afe064 100755 --- a/t/t9826-git-p4-keep-empty-commits.sh +++ b/t/t9826-git-p4-keep-empty-commits.sh @@ -127,8 +127,4 @@ test_expect_success 'Clone repo subdir with all history' ' ) ' -test_expect_success 'kill p4d' ' - kill_p4d -' - test_done diff --git a/t/t9827-git-p4-change-filetype.sh b/t/t9827-git-p4-change-filetype.sh index 7433998f47..d3670bd7a2 100755 --- a/t/t9827-git-p4-change-filetype.sh +++ b/t/t9827-git-p4-change-filetype.sh @@ -59,8 +59,4 @@ test_expect_success SYMLINKS 'change symbolic link to file' ' ) ' -test_expect_success 'kill p4d' ' - kill_p4d -' - test_done diff --git a/t/t9828-git-p4-map-user.sh b/t/t9828-git-p4-map-user.sh index e20395c89f..ca6c2942bd 100755 --- a/t/t9828-git-p4-map-user.sh +++ b/t/t9828-git-p4-map-user.sh @@ -54,8 +54,4 @@ test_expect_success 'Clone repo root path with all history' ' ) ' -test_expect_success 'kill p4d' ' - kill_p4d -' - test_done diff --git a/t/t9829-git-p4-jobs.sh b/t/t9829-git-p4-jobs.sh index 971aeeea1f..88cfb1fcd3 100755 --- a/t/t9829-git-p4-jobs.sh +++ b/t/t9829-git-p4-jobs.sh @@ -92,8 +92,4 @@ test_expect_success 'check log message of changelist with more jobs' ' ) ' -test_expect_success 'kill p4d' ' - kill_p4d -' - test_done diff --git a/t/t9830-git-p4-symlink-dir.sh b/t/t9830-git-p4-symlink-dir.sh index 2ad1b0810d..3fb6960c18 100755 --- a/t/t9830-git-p4-symlink-dir.sh +++ b/t/t9830-git-p4-symlink-dir.sh @@ -36,8 +36,4 @@ test_expect_success 'symlinked directory' ' ' -test_expect_success 'kill p4d' ' - kill_p4d -' - test_done diff --git a/t/t9831-git-p4-triggers.sh b/t/t9831-git-p4-triggers.sh index be44c9751a..d743ca33ee 100755 --- a/t/t9831-git-p4-triggers.sh +++ b/t/t9831-git-p4-triggers.sh @@ -96,8 +96,4 @@ test_expect_success 'submit description with extra info lines from verbose p4 ch ) ' -test_expect_success 'kill p4d' ' - kill_p4d -' - test_done diff --git a/t/t9832-unshelve.sh b/t/t9832-unshelve.sh index 48ec7679b8..b649d1b7c3 100755 --- a/t/t9832-unshelve.sh +++ b/t/t9832-unshelve.sh @@ -131,8 +131,4 @@ test_expect_success 'try to unshelve the change' ' ) ' -test_expect_success 'kill p4d' ' - kill_p4d -' - test_done diff --git a/t/t9833-errors.sh b/t/t9833-errors.sh index 277d347012..1f3d879122 100755 --- a/t/t9833-errors.sh +++ b/t/t9833-errors.sh @@ -72,9 +72,4 @@ test_expect_success 'git operation with expired ticket' ' ) ' -test_expect_success 'kill p4d' ' - kill_p4d -' - - test_done From patchwork Mon Oct 15 10:12:12 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Arver via GitGitGadget X-Patchwork-Id: 10641507 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 60EA11057 for ; Mon, 15 Oct 2018 10:12:17 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4FD9528C82 for ; Mon, 15 Oct 2018 10:12:17 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 440A02942E; Mon, 15 Oct 2018 10:12:17 +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 CD8B428C82 for ; Mon, 15 Oct 2018 10:12:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726846AbeJOR4t (ORCPT ); Mon, 15 Oct 2018 13:56:49 -0400 Received: from mail-pg1-f180.google.com ([209.85.215.180]:37630 "EHLO mail-pg1-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726515AbeJOR4t (ORCPT ); Mon, 15 Oct 2018 13:56:49 -0400 Received: by mail-pg1-f180.google.com with SMTP id c10-v6so8945687pgq.4 for ; Mon, 15 Oct 2018 03:12:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:message-id:in-reply-to:references:from:subject:fcc :content-transfer-encoding:mime-version:to:cc; bh=MNwt14ajK0Mfe3nbcyzjOF8rPdvapSkedNcN49vcCPU=; b=nhmz0Pb5mzDL4sS5WEyKVoM4TMOgWoGQkTouYyJ4tHtTR140PVMfOsf0rnN5eDvl+n Mj+wR2q5wI1Bd5z/3Y5PXTH8S9ptMIFpM79HXtRoXDzpai5UyTWE/vFgiuVauOYr6UyK 11TIvubDyL3Gl4N3b0Mqqc7NMSFJ2zWKgx+8KlVEhmRrCsZUSV9B5QrVWAnomxOZ/FEF ls9rBJd6SxdFMhGfwiiv/hvEYWltKjHdCjksnDPi/TXFPzUkb6+YopgoN6plvUHnEbMC 96Jc/Vu3fJGAyffTzGW5Rz1iEQKY9ARm6/GoEyv63HH7BrNHeAf47HV0WJ/R0gx1KVlg ow/g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:message-id:in-reply-to:references:from :subject:fcc:content-transfer-encoding:mime-version:to:cc; bh=MNwt14ajK0Mfe3nbcyzjOF8rPdvapSkedNcN49vcCPU=; b=prlk/CgZNRxamCM35eSjV9DTZbR8tWPYMnUq74+WQM2d7u5DMYcjHuYLpev8bUPVLF 26adgoybg12FIaeFam0U/3QYnuDsbHvci9Fqekyoi2O5qS1QVS9fNQiBRXH7hhIRw0WP ecMXya6jrowq8234Gzd/FDHWtWikpDaoB6OiajhGM6fhDjRssA+q0UaNPibvKjJouuxo H+9REMxpdBWoNmWWrasstyxA+RUnBTCvu4sewXeI+hQ4xgfdoiRXpNKbO8JU27vPNTI0 jLJjqwArzRugfFS5cepwMhAcmdUnpYNj09l47l1sXYHo8bINiKEHbXHiAWdzw/bSXu3g F8tQ== X-Gm-Message-State: ABuFfojsI0YG0rKJnL3SDf+c+4VLVvMT2ra1GimclDsmaEnhyI8/ukWE TkrzIwrDmpk4tI4PTLMrIasES/Ig X-Google-Smtp-Source: ACcGV62Kll7DirrLXCMTSR6RiqS+gUGQgyYWqn8cy+KAl3ttEJKIffMhHMc+aoaw6JWxDRGrA3RpAg== X-Received: by 2002:aa7:8715:: with SMTP id b21-v6mr16790037pfo.250.1539598333497; Mon, 15 Oct 2018 03:12:13 -0700 (PDT) Received: from [127.0.0.1] ([40.112.137.127]) by smtp.gmail.com with ESMTPSA id 84-v6sm12520929pfv.33.2018.10.15.03.12.12 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 15 Oct 2018 03:12:12 -0700 (PDT) Date: Mon, 15 Oct 2018 03:12:12 -0700 (PDT) X-Google-Original-Date: Mon, 15 Oct 2018 10:11:52 GMT Message-Id: In-Reply-To: References: From: "Johannes Schindelin via GitGitGadget" Subject: [PATCH v2 10/13] tests: include detailed trace logs with --write-junit-xml upon failure Fcc: Sent MIME-Version: 1.0 To: git@vger.kernel.org Cc: Junio C Hamano , Johannes Schindelin Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Johannes Schindelin The JUnit XML format lends itself to be presented in a powerful UI, where you can drill down to the information you are interested in very quickly. For test failures, this usually means that you want to see the detailed trace of the failing tests. With Travis CI, we passed the `--verbose-log` option to get those traces. However, that seems excessive, as we do not need/use the logs in almost all of those cases: only when a test fails do we have a way to include the trace. So let's do something different when using Azure DevOps: let's run all the tests with `--quiet` first, and only if a failure is encountered, try to trace the commands as they are executed. Of course, we cannot turn on `--verbose-log` after the fact. So let's just re-run the test with all the same options, adding `--verbose-log`. And then munging the output file into the JUnit XML on the fly. Note: there is an off chance that re-running the test in verbose mode "fixes" the failures (and this does happen from time to time!). That is a possibility we should be able to live with. Ideally, we would label this as "Passed upon rerun", and Azure Pipelines even know about that outcome, but it is not available when using the JUnit XML format for now: https://github.com/Microsoft/azure-pipelines-agent/blob/master/src/Agent.Worker/TestResults/JunitResultReader.cs Signed-off-by: Johannes Schindelin --- t/test-lib.sh | 34 +++++++++++++++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/t/test-lib.sh b/t/test-lib.sh index 6f9c1f5300..8a60e39364 100644 --- a/t/test-lib.sh +++ b/t/test-lib.sh @@ -85,6 +85,13 @@ done,*) test "$(cat "$BASE.exit")" = 0 exit ;; +*' --write-junit-xml '*) + # record how to call this script *with* --verbose-log, in case + # we encounter a breakage + junit_rerun_options_sq="$(printf '%s\n' "$0" --verbose-log -x "$@" | + sed -e "s/'/'\\\\''/g" -e "s/^/'/" -e "s/\$/'/" | + tr '\012' ' ')" + ;; esac # For repeatability, reset the environment to known value. @@ -446,10 +453,31 @@ test_ok_ () { test_failure_ () { if test -n "$write_junit_xml" then + if test -z "$GIT_TEST_TEE_OUTPUT_FILE" + then + # clean up + test_atexit_handler + + # re-run with --verbose-log + echo "# Re-running: $junit_rerun_options_sq" >&2 + + cd "$TEST_DIRECTORY" && + eval "${TEST_SHELL_PATH}" "$junit_rerun_options_sq" \ + >/dev/null 2>&1 + status=$? + + say_color "" "$(test 0 = $status || + echo "not ")ok $test_count - (re-ran with trace)" + say "1..$test_count" + GIT_EXIT_OK=t + exit $status + fi + junit_insert="" junit_insert="$junit_insert $(xml_attr_encode \ - "$(printf '%s\n' "$@" | sed 1d)")" + "$(cat "$GIT_TEST_TEE_OUTPUT_FILE")")" + >"$GIT_TEST_TEE_OUTPUT_FILE" junit_insert="$junit_insert" write_junit_xml_testcase "$1" " $junit_insert" fi @@ -734,6 +762,10 @@ test_start_ () { if test -n "$write_junit_xml" then junit_start=$(test-tool date getnanos) + + # truncate output + test -z "$GIT_TEST_TEE_OUTPUT_FILE" || + >"$GIT_TEST_TEE_OUTPUT_FILE" fi } From patchwork Mon Oct 15 10:12:14 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Arver via GitGitGadget X-Patchwork-Id: 10641509 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 A30F215E2 for ; Mon, 15 Oct 2018 10:12:17 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9106128C82 for ; Mon, 15 Oct 2018 10:12:17 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 857282941A; Mon, 15 Oct 2018 10:12:17 +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 2EC4329270 for ; Mon, 15 Oct 2018 10:12:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726854AbeJOR4u (ORCPT ); Mon, 15 Oct 2018 13:56:50 -0400 Received: from mail-pl1-f169.google.com ([209.85.214.169]:38603 "EHLO mail-pl1-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726515AbeJOR4u (ORCPT ); Mon, 15 Oct 2018 13:56:50 -0400 Received: by mail-pl1-f169.google.com with SMTP id q19-v6so5993211pll.5 for ; Mon, 15 Oct 2018 03:12:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:message-id:in-reply-to:references:from:subject:fcc :content-transfer-encoding:mime-version:to:cc; bh=mvvHsQO1GjK40FP4netT5PvH72cbiJBboalGZL/DDPQ=; b=vZg4RJ2Iv9iKNjRs6zZpRwCNz4Uk4vkA7eDG8jxdmxRDjo6fvaaTtuIfOtH85t4JqX xv0wsfKBrNRI/6ZNUUUMBjYLXfHtGjUJ8s6C39QCrllYO6wevVx0DuAQGwbp3+Bb389w 1mIXApji1pJ2ygTcPqAO1ONRACIhGHVeJbCv32mM5SNL8K0S8f7yQu1OPkiCUVrOpofv wX+hND1TszI/Y317Nrlcc49y2zUMLpdittSloVgFpHobdBzEleBwpzZx8QmkemuYx0Jn N3HuHc+pALYlP+Pa+zpka6nE8rs3NCU3Ov/+CpWLCYO2LM5VS/an6xsa9/Sq2O0p1tPv uCDA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:message-id:in-reply-to:references:from :subject:fcc:content-transfer-encoding:mime-version:to:cc; bh=mvvHsQO1GjK40FP4netT5PvH72cbiJBboalGZL/DDPQ=; b=Ac7zRqYJCFeeyY2PapnoV49gdRna7bNVI/wOBPHPD/I3+LRqi/663QZ68urp5QEfiz /LX5pc1mYjCXkPbC30wGHSHevgBoq+0lX0fRfYJL7yD+cq8dYXY+nuPqkYUkFpBPMw2c Er5hw4jy/EG9l/MIO5+abnAbyDQ7tlk+uqa1Qa/OBHZNLRrhFycOgRK1QC//JB+DoRJm 6inMGbJOSfeUyu3Vqu7fJL0x8IzO+q+rOSkLq7ZyRNybyGBQWExTRbfiN2WumdzwOj/x XoZwbBMBsFGObAOvwrWFOhVuiPnOXAnGr1019odRD0s8uqr/Z5+RKdK8+wW98qrLnfrY LHpQ== X-Gm-Message-State: ABuFfohXBjcHr+onZmAVvtdGOoPZqHkRbRJgdT4RtRIgxub8Q+xv5XWg 1ZfcEcL7hUsQhOTho2WE6p8FT3ln X-Google-Smtp-Source: ACcGV63cE+zXoOeeQW+oqKZdL+XQZ28MnDgXNMFNcCx0p9tLH9rjwKAMFISIPWy3LZ5X7DAUscWGSg== X-Received: by 2002:a17:902:9a98:: with SMTP id w24-v6mr16707713plp.109.1539598335090; Mon, 15 Oct 2018 03:12:15 -0700 (PDT) Received: from [127.0.0.1] ([40.112.137.127]) by smtp.gmail.com with ESMTPSA id y85-v6sm19534108pfa.120.2018.10.15.03.12.13 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 15 Oct 2018 03:12:14 -0700 (PDT) Date: Mon, 15 Oct 2018 03:12:14 -0700 (PDT) X-Google-Original-Date: Mon, 15 Oct 2018 10:11:53 GMT Message-Id: <2466a48aa3eedc703263c2b63c9c7b5f13f0194a.1539598316.git.gitgitgadget@gmail.com> In-Reply-To: References: From: "Johannes Schindelin via GitGitGadget" Subject: [PATCH v2 11/13] tests: record more stderr with --write-junit-xml in case of failure Fcc: Sent MIME-Version: 1.0 To: git@vger.kernel.org Cc: Junio C Hamano , Johannes Schindelin Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Johannes Schindelin Sometimes, failures in a test case are actually caused by issues in earlier test cases. To make it easier to see those issues, let's attach the output from before the failing test case (i.e. stdout/stderr since the previous failing test case, or the start of the test script). This will be visible in the "Attachments" of the details of the failed test. Signed-off-by: Johannes Schindelin --- t/test-lib.sh | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/t/test-lib.sh b/t/test-lib.sh index 8a60e39364..5f62418f9c 100644 --- a/t/test-lib.sh +++ b/t/test-lib.sh @@ -479,6 +479,9 @@ test_failure_ () { "$(cat "$GIT_TEST_TEE_OUTPUT_FILE")")" >"$GIT_TEST_TEE_OUTPUT_FILE" junit_insert="$junit_insert" + junit_insert="$junit_insert$(xml_attr_encode \ + "$(cat "$GIT_TEST_TEE_OUTPUT_FILE.err")")" + >"$GIT_TEST_TEE_OUTPUT_FILE.err" write_junit_xml_testcase "$1" " $junit_insert" fi test_failure=$(($test_failure + 1)) @@ -763,9 +766,12 @@ test_start_ () { then junit_start=$(test-tool date getnanos) - # truncate output - test -z "$GIT_TEST_TEE_OUTPUT_FILE" || - >"$GIT_TEST_TEE_OUTPUT_FILE" + # append to future ; truncate output + test -z "$GIT_TEST_TEE_OUTPUT_FILE" || { + cat "$GIT_TEST_TEE_OUTPUT_FILE" \ + >>"$GIT_TEST_TEE_OUTPUT_FILE.err" + >"$GIT_TEST_TEE_OUTPUT_FILE" + } fi } From patchwork Mon Oct 15 10:12:15 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Arver via GitGitGadget X-Patchwork-Id: 10641511 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 1C485157A for ; Mon, 15 Oct 2018 10:12:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0A45228C82 for ; Mon, 15 Oct 2018 10:12:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F33072941A; Mon, 15 Oct 2018 10:12:18 +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 A793D28C82 for ; Mon, 15 Oct 2018 10:12:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726864AbeJOR4v (ORCPT ); Mon, 15 Oct 2018 13:56:51 -0400 Received: from mail-pl1-f196.google.com ([209.85.214.196]:42921 "EHLO mail-pl1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726515AbeJOR4v (ORCPT ); Mon, 15 Oct 2018 13:56:51 -0400 Received: by mail-pl1-f196.google.com with SMTP id c8-v6so9058473plo.9 for ; Mon, 15 Oct 2018 03:12:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:message-id:in-reply-to:references:from:subject:fcc :content-transfer-encoding:mime-version:to:cc; bh=KzlLIGxx9+aqELb0V5crwgVyly++qKQCjMv9vKGoJAE=; b=OIozRRVGW8uw7Sb9vq5eBhW28mLigrmqi0HHYRMfwfSYKh53/S2W5w8KyK8WXAVjCB Wbddbul4bcvmu+HDfspbxq6H+KgAbXjjqt2tUkeMzeVQ2esB7wUG5rvRfBJ2kD5MVOkH a0FQlf6l0HXsaVno09gN5P9m2Tm0anlqu7995ynKSSp//FC4vnOuk6D3jhZ9z3hiNll3 OyDFlJvFiA0Zje65rtg6lyX8z0oHuB58Apx9Kmj1gUS7TxKjvZT0eat3NINAQQEEl61X 9c2k4oMYwaDyM5VuQBdIqT6J6T/lmiPBfiSbJ63Kz4tXmUN4UEguIqcwNEfwU7wxKe3U 1u1A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:message-id:in-reply-to:references:from :subject:fcc:content-transfer-encoding:mime-version:to:cc; bh=KzlLIGxx9+aqELb0V5crwgVyly++qKQCjMv9vKGoJAE=; b=HaoEzKJ7hVrdc8Wpet0lSxDQ7VgUBxAkIbevixT3hSOj2FuCPCrtDbUFqGBRwPhNJA /h1g7H8YUKn4A60VEQdNqXWqiGbpgS596MGVD/4ExBmqyQfutZBJ4Z8kfMPUpTimKG+I bW+0mXtmXbAcYhxgP85DlqD+kGId+04mfj+xzVAjwyVzFg2ddQDHPiJuctXw/vw1Fj3I NkLrGV+qGKb3DEg+uEyLPpx42WQcNlRgbZ6dwR4vtli3WuUQ60ysaNx6J9MKJapS6w45 6BxKRufS2DPL0TFiNuNYwNzXCmAZfvt5CFX+HJXahN0eTcdDsDImhSZ3miyeSPSI/wYB Mblg== X-Gm-Message-State: ABuFfoiEsRvoGQgn47KeUlYndBJvWGCoizhG3OjI9XTFQULxy10YAGMP UXlH+sT/JqwX+sq2O4uDJ1c1wdnA X-Google-Smtp-Source: ACcGV62O/XE4b35IkwDmNwtgUHfKe+uwhLpgRUb1gqWMi2Jz6sP00IYJP+T/+Arka3gdW5FhZQDWcQ== X-Received: by 2002:a17:902:5993:: with SMTP id p19-v6mr16427307pli.260.1539598336460; Mon, 15 Oct 2018 03:12:16 -0700 (PDT) Received: from [127.0.0.1] ([40.112.137.127]) by smtp.gmail.com with ESMTPSA id c2-v6sm12160099pfn.95.2018.10.15.03.12.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 15 Oct 2018 03:12:15 -0700 (PDT) Date: Mon, 15 Oct 2018 03:12:15 -0700 (PDT) X-Google-Original-Date: Mon, 15 Oct 2018 10:11:54 GMT Message-Id: In-Reply-To: References: From: "Johannes Schindelin via GitGitGadget" Subject: [PATCH v2 12/13] README: add a build badge (status of the Azure Pipelines build) Fcc: Sent MIME-Version: 1.0 To: git@vger.kernel.org Cc: Junio C Hamano , Johannes Schindelin Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Johannes Schindelin Just like so many other OSS projects, we now also have a build badge. Signed-off-by: Johannes Schindelin --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index f920a42fad..bf4780c22d 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,5 @@ +[![Build Status](https:/dev.azure.com/git/git/_apis/build/status/test-git.git)](https://dev.azure.com/git/git/_build/latest?definitionId=2) + Git - fast, scalable, distributed revision control system ========================================================= From patchwork Mon Oct 15 10:12:17 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Arver via GitGitGadget X-Patchwork-Id: 10641513 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 BEF8C1057 for ; Mon, 15 Oct 2018 10:12:21 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AD5D428C82 for ; Mon, 15 Oct 2018 10:12:21 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A1B6E2941A; Mon, 15 Oct 2018 10:12:21 +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 5125728C82 for ; Mon, 15 Oct 2018 10:12:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726915AbeJOR4x (ORCPT ); Mon, 15 Oct 2018 13:56:53 -0400 Received: from mail-pf1-f194.google.com ([209.85.210.194]:42124 "EHLO mail-pf1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726868AbeJOR4x (ORCPT ); Mon, 15 Oct 2018 13:56:53 -0400 Received: by mail-pf1-f194.google.com with SMTP id f26-v6so9427975pfn.9 for ; Mon, 15 Oct 2018 03:12:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:message-id:in-reply-to:references:from:subject:fcc :content-transfer-encoding:mime-version:to:cc; bh=uVPhXeh89yk5WHqhnJElovYyBG2HPAq9b4dHJaQ+mjM=; b=f9eJptoyW9M+JJkkq2na20LqBFS4snNhqmKDUtUlRA1bAfUj+m3ZZMKzjnyEJ2JeFM l3YnkBE8LmgXYtWsl2W5QR3nIfHeoQqACO1szFh+KBtJ4d9pUmBTgcC0rCUjVkHnRTJm J+ZGhSbei6yxZhr6IO2yGb6clzvlJO2ldTJACJIQ50tax+kgoe/tVjk0kwWZhTvqmO4+ 28QV84WXrboqdnu7qVLH5pxT/glp6smDcgpYrOkOYLqYg3Qokgk4hpOO2Bkf2e0s2DVK xhCfPo13TRFtR6YhmisybGe1M/larPzKASKD8kH8SnMCMMrkwnvAv7/oH497EKn7clkW 5dGQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:message-id:in-reply-to:references:from :subject:fcc:content-transfer-encoding:mime-version:to:cc; bh=uVPhXeh89yk5WHqhnJElovYyBG2HPAq9b4dHJaQ+mjM=; b=kV3hKB1nctnJGbpGZUxxE+wk5yDnwpNXne8IhdwKoAwpOxSt6nzC/7wKUzIDMm3cOD 6S4jkKvf9F6JW7yUPLxRlY7VkoZkAwee7m9Y22JwFuVhOwSm4MH8YL/Qv3wI5nCyY9kb iDNOLM0mWX1l6ytTDiF1+UYk56FGS3pB9iWtGw87TfVGinAGfMldoFQVONdLoXODbc2A qR/Sh/9cUtLa3D12lI6Wa8gOAE2BWu8j8zarVQbHXRaxvxE+Q6yyFePBUJwJ273UkiiO JMegZ/TruLWiXt2nboAASOpHqAUwpD1x4BIuQ1BU/yJvAuvnc+jmtdE9VETbBjLgQKnB 3sEQ== X-Gm-Message-State: ABuFfogFvABMRlI/pqV2IwYx3SctgplOAZk0BCuHE9cHUXP0m9/CThOO I84cZBoB/zZz+Vknqw4VaLvA7qHY X-Google-Smtp-Source: ACcGV637DehbJEFyBYyZJfKZoTvrvpJqNb5LHDaeeIFCD7k0yEovN3VewkouBz4uKte2O6VpZEf4Sg== X-Received: by 2002:a62:c68e:: with SMTP id x14-v6mr9124937pfk.151.1539598337849; Mon, 15 Oct 2018 03:12:17 -0700 (PDT) Received: from [127.0.0.1] ([40.112.137.127]) by smtp.gmail.com with ESMTPSA id d18-v6sm11506807pgd.86.2018.10.15.03.12.16 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 15 Oct 2018 03:12:17 -0700 (PDT) Date: Mon, 15 Oct 2018 03:12:17 -0700 (PDT) X-Google-Original-Date: Mon, 15 Oct 2018 10:11:55 GMT Message-Id: <0a53f371350146ecd01b44f0f42da447d7573689.1539598316.git.gitgitgadget@gmail.com> In-Reply-To: References: From: "Johannes Schindelin via GitGitGadget" Subject: [PATCH v2 13/13] travis: fix skipping tagged releases Fcc: Sent MIME-Version: 1.0 To: git@vger.kernel.org Cc: Junio C Hamano , Johannes Schindelin Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Johannes Schindelin When building a PR, TRAVIS_BRANCH refers to the *target branch*. Therefore, if a PR targets `master`, and `master` happened to be tagged, we skipped the build by mistake. Fix this by using TRAVIS_PULL_REQUEST_BRANCH (i.e. the *source branch*) when available, falling back to TRAVIS_BRANCH (i.e. for CI builds, also known as "push builds"). Signed-off-by: Johannes Schindelin --- ci/lib.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/lib.sh b/ci/lib.sh index 584abcd529..e1858ae609 100755 --- a/ci/lib.sh +++ b/ci/lib.sh @@ -3,7 +3,7 @@ if test true = "$TRAVIS" then # We are running within Travis CI - CI_BRANCH="$TRAVIS_BRANCH" + CI_BRANCH="${TRAVIS_PULL_REQUEST_BRANCH:-$TRAVIS_BRANCH}" CI_COMMIT="$TRAVIS_COMMIT" CI_JOB_ID="$TRAVIS_JOB_ID" CI_JOB_NUMBER="$TRAVIS_JOB_NUMBER"