From 4500e2008b5fb75929763091a7de2401dbfe70f1 Mon Sep 17 00:00:00 2001 From: "brian m. carlson" Date: Thu, 13 Sep 2018 22:41:11 +0000 Subject: [PATCH] t: ensure client cert integration test runs completely The shell function that performed the clone for the client certificate test contained several branches, each of which ended with an exit. This caused the test to always exit early (and in the normal case, successfully) without running the rest of the test. Change this function to use "return" instead of "exit" so that the test runs to completion, and fix the single failing assertion. Ignore this test on Travis CI, just like we do for the other SSL test, for exactly the same reason. Note that this appears to be the only test helper that has this problem: the other uses of "exit" in the test helpers are all either to skip tests or to exit unsuccessfully, the latter of which is equivalent to returning unsuccessfully under set -e (which we use). --- t/t-clone.sh | 6 +++++- t/testhelpers.sh | 6 +++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/t/t-clone.sh b/t/t-clone.sh index 8d4595dc..bbe13a44 100755 --- a/t/t-clone.sh +++ b/t/t-clone.sh @@ -150,6 +150,11 @@ end_test begin_test "clone ClientCert" ( set -e + if $TRAVIS; then + echo "Skipping SSL tests, Travis has weird behaviour in validating custom certs, test locally only" + exit 0 + fi + reponame="test-cloneClientCert" setup_remote_repo "$reponame" clone_repo_clientcert "$reponame" "$reponame" @@ -184,7 +189,6 @@ begin_test "clone ClientCert" newclonedir="testcloneClietCert1" git lfs clone "$CLIENTCERTGITSERVER/$reponame" "$newclonedir" 2>&1 | tee lfsclone.log grep "Cloning into" lfsclone.log - grep "Git LFS:" lfsclone.log # should be no filter errors [ ! $(grep "filter" lfsclone.log) ] [ ! $(grep "error" lfsclone.log) ] diff --git a/t/testhelpers.sh b/t/testhelpers.sh index 3e86322b..90e6d4fd 100644 --- a/t/testhelpers.sh +++ b/t/testhelpers.sh @@ -418,16 +418,16 @@ clone_repo_clientcert() { echo "$out" > clone_client_cert.log git config credential.helper lfstest - exit 0 + return 0 fi echo "$out" > clone_client_cert.log if [ $(grep -c "NSInvalidArgumentException" clone_client_cert.log) -gt 0 ]; then echo "client-cert-mac-openssl" > clone_client_cert.log - exit 0 + return 0 fi - exit 1 + return 1 } # setup_remote_repo_with_file creates a remote repo, clones it locally, commits