Fix another -z that should have been -n. refs #3894
[arvados-dev.git] / jenkins / run-tests.sh
index 742baebad07df6f3bd3825da5f6b211f998fd3c4..45cdadcb36f6a77816000d669d12728a179dde46 100755 (executable)
@@ -20,6 +20,7 @@ Options:
                from a previous invocation if you use this option.
 WORKSPACE=path Arvados source tree to test.
 CONFIGSRC=path Dir with api server config files to copy into source tree.
+               (If none given, leave config files alone in source tree.)
 apiserver_test="TEST=test/functional/arvados/v1/collections_test.rb"
                Restrict apiserver tests to the given file
 python_sdk_test="--test-suite test.test_keep_locator"
@@ -36,6 +37,9 @@ into \$GOPATH, \$VENDIR, and \$GEMHOME before running any tests. Many
 test suites depend on other components being installed, and installing
 everything tends to be quicker than debugging dependencies.
 
+As a special concession to the current CI server config, CONFIGSRC
+defaults to $HOME/arvados-api-server if that directory exists.
+
 More information and background:
 
 https://arvados.org/projects/arvados/wiki/Running_tests
@@ -84,7 +88,7 @@ clear_temp() {
             leaving+=" $var=\"${!var}\""
         fi
     done
-    if [[ -z "$leaving" ]]; then
+    if [[ -n "$leaving" ]]; then
         echo "Leaving behind temp dirs: $leaving"
     fi
 }
@@ -156,11 +160,9 @@ done
 echo "WORKSPACE=$WORKSPACE"
 [[ -n "$WORKSPACE" ]] || fatal "WORKSPACE not set"
 
-if [[ -n "$CONFIGSRC" ]]; then
-    if [[ -d "$HOME/arvados-api-server" ]]; then
-        # Jenkins expects us to use this by default.
-        CONFIGSRC="$HOME/arvados-api-server"
-    fi
+if [[ -z "$CONFIGSRC" ]] && [[ -d "$HOME/arvados-api-server" ]]; then
+    # Jenkins expects us to use this by default.
+    CONFIGSRC="$HOME/arvados-api-server"
 fi
 
 # Set up temporary install dirs (unless existing dirs were supplied)