From be7581dc38f16411bd4a639da4dc62c286fc316e Mon Sep 17 00:00:00 2001 From: Rick Olson Date: Thu, 21 May 2015 11:51:40 -0600 Subject: [PATCH] add SKIPCOMPILE to tests --- test/README.md | 9 +++++++++ test/testhelpers.sh | 15 ++++++++++----- 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/test/README.md b/test/README.md index 14bc45d8..c00d8c48 100644 --- a/test/README.md +++ b/test/README.md @@ -64,6 +64,15 @@ section. 5. Failing test runs should dump enough information to diagnose the bug. This includes stdout, stderr, any log files, and even the OS environment. +There are a few environment variables that you can set to change the test suite +behavior: + +* `KEEPTRASH=1` - This will leave the local repository data in a `tmp` directory +and the remote repository data in `test/remote`. +* `SKIPCOMPILE=1` - This skips the Git LFS compilation step. Speeds up the +tests when you're running the same test script multiple times without changing +any Go code. + ### Test Suite The `testenv.sh` script includes some global variables used in tests. This diff --git a/test/testhelpers.sh b/test/testhelpers.sh index c3f34960..5e27dbfc 100644 --- a/test/testhelpers.sh +++ b/test/testhelpers.sh @@ -115,13 +115,18 @@ setup() { rm -rf "test/remote" mkdir "test/remote" - echo "compile git-lfs for $0" - script/bootstrap + if [ -z "$SKIPCOMPILE" ]; then + echo "compile git-lfs for $0" + script/bootstrap + fi + $GITLFS version - for go in test/cmd/*.go; do - go build -o "$BINPATH/$(basename $go .go)" "$go" - done + if [ -z "$SKIPCOMPILE" ]; then + for go in test/cmd/*.go; do + go build -o "$BINPATH/$(basename $go .go)" "$go" + done + fi 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 &