From 1a3d6a889323f26acd2c572466356f9591f3147c Mon Sep 17 00:00:00 2001 From: Edward Thomson Date: Thu, 29 Feb 2024 18:24:38 +0000 Subject: [PATCH] ci: allow opting out of push-options tests The push-options online tests require push options support in the git itself that's on the system. Allow callers with old git to opt out. --- .github/actions/run-build/action.yml | 1 + ci/test.sh | 15 +++++---------- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/.github/actions/run-build/action.yml b/.github/actions/run-build/action.yml index bd0f59c9a..9afcfb11e 100644 --- a/.github/actions/run-build/action.yml +++ b/.github/actions/run-build/action.yml @@ -40,6 +40,7 @@ runs: -e PKG_CONFIG_PATH \ -e SKIP_NEGOTIATE_TESTS \ -e SKIP_SSH_TESTS \ + -e SKIP_PUSHOPTIONS_TESTS \ -e TSAN_OPTIONS \ -e UBSAN_OPTIONS \ ${{ inputs.container-version }} \ diff --git a/ci/test.sh b/ci/test.sh index 5f6b3c31d..98093c6ec 100755 --- a/ci/test.sh +++ b/ci/test.sh @@ -18,6 +18,11 @@ if [[ "$(uname -s)" == MINGW* ]]; then SKIP_NTLM_TESTS=1 fi +# older versions of git don't support push options +if [ -z "$SKIP_PUSHOPTIONS_TESTS" ]; then + export GITTEST_PUSH_OPTIONS=true +fi + SOURCE_DIR=${SOURCE_DIR:-$( cd "$( dirname "${BASH_SOURCE[0]}" )" && dirname $( pwd ) )} BUILD_DIR=$(pwd) BUILD_PATH=${BUILD_PATH:=$PATH} @@ -324,10 +329,8 @@ if should_run "GITDAEMON_TESTS"; then echo "" export GITTEST_REMOTE_URL="git://localhost/test.git" - export GITTEST_PUSH_OPTIONS=true run_test gitdaemon unset GITTEST_REMOTE_URL - unset GITTEST_PUSH_OPTIONS echo "" echo "Running gitdaemon (namespace) tests" @@ -382,12 +385,10 @@ if should_run "NTLM_TESTS"; then export GITTEST_REMOTE_URL="http://localhost:9000/ntlm/test.git" export GITTEST_REMOTE_USER="foo" export GITTEST_REMOTE_PASS="baz" - export GITTEST_PUSH_OPTIONS=true run_test auth_clone_and_push unset GITTEST_REMOTE_URL unset GITTEST_REMOTE_USER unset GITTEST_REMOTE_PASS - unset GITTEST_PUSH_OPTIONS echo "" echo "Running NTLM tests (Apache emulation)" @@ -396,12 +397,10 @@ if should_run "NTLM_TESTS"; then export GITTEST_REMOTE_URL="http://localhost:9000/broken-ntlm/test.git" export GITTEST_REMOTE_USER="foo" export GITTEST_REMOTE_PASS="baz" - export GITTEST_PUSH_OPTIONS=true run_test auth_clone_and_push unset GITTEST_REMOTE_URL unset GITTEST_REMOTE_USER unset GITTEST_REMOTE_PASS - unset GITTEST_PUSH_OPTIONS fi if should_run "NEGOTIATE_TESTS" && -n "$GITTEST_NEGOTIATE_PASSWORD" ; then @@ -451,20 +450,16 @@ if should_run "SSH_TESTS"; then echo "" export GITTEST_REMOTE_URL="ssh://localhost:2222/$SSHD_DIR/test.git" - export GITTEST_PUSH_OPTIONS=true run_test ssh unset GITTEST_REMOTE_URL - unset GITTEST_PUSH_OPTIONS echo "" echo "Running ssh tests (scp-style paths)" echo "" export GITTEST_REMOTE_URL="[localhost:2222]:$SSHD_DIR/test.git" - export GITTEST_PUSH_OPTIONS=true run_test ssh unset GITTEST_REMOTE_URL - unset GITTEST_PUSH_OPTIONS unset GITTEST_SSH_CMD