diff --git a/script/integration b/script/integration index a69c0180..7ab1d25c 100755 --- a/script/integration +++ b/script/integration @@ -2,32 +2,35 @@ . "test/testenv.sh" +SHUTDOWN_LFS=no +SHOW_LOGS=yes + atexit() { - if [ -s "$REMOTEDIR/gitserver.log" ]; then + if [ "$SHOW_LOGS" == "yes" ]; then + if [ -s "$REMOTEDIR/gitserver.log" ]; then + echo "" + echo "gitserver.log:" + cat "$REMOTEDIR/gitserver.log" + fi + echo "" - echo "gitserver.log:" - cat "$REMOTEDIR/gitserver.log" + echo "env:" + env fi - echo "" - echo "env:" - env - - SHUTDOWN_LFS=yes - GITSERVER=$(cat "$LFS_URL_FILE") shutdown - rm -rf $TRASHDIR } trap "atexit" EXIT if [ -s "$LFS_URL_FILE" ]; then + SHOW_LOGS=no echo "$LFS_URL_FILE still exists!" exit 1 fi setup -echo "run some tests, yo" - test/test-happy-path.sh + +SHUTDOWN_LFS=yes diff --git a/test/testhelpers.sh b/test/testhelpers.sh index 1f256702..552efef5 100644 --- a/test/testhelpers.sh +++ b/test/testhelpers.sh @@ -99,7 +99,6 @@ setup() { go build -o "$BINPATH/$(basename $go .go)" "$go" done - echo "PATH=$BINPATH:\$PATH" echo "LFSTEST_URL=$LFS_URL_FILE LFSTEST_DIR=$REMOTEDIR lfstest-gitserver" LFSTEST_URL="$LFS_URL_FILE" LFSTEST_DIR="$REMOTEDIR" lfstest-gitserver > "$REMOTEDIR/gitserver.log" 2>&1 & wait_for_file "$LFS_URL_FILE" @@ -112,6 +111,7 @@ shutdown() { exit 0 fi - curl "$GITSERVER/shutdown" - rm -rf "$LFS_URL_FILE" + if [ -s "$LFS_URL_FILE" ]; then + curl "$(cat "$LFS_URL_FILE")/shutdown" + fi }