From d5f6b97b206814e502d7fbc6790678a08553599c Mon Sep 17 00:00:00 2001 From: Brian Waldon Date: Thu, 22 Jan 2015 17:29:31 -0800 Subject: [PATCH] test: do not run integration tests by default The ./test script will no longer run the integration tests. To run the integration test, set the INTEGRATION env var to a nonzero value. For example, `INTEGRATION=y ./test`. --- .travis.yml | 2 +- test | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 7af8a5ed1..44aabdee0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,4 +8,4 @@ install: - go get code.google.com/p/go.tools/cmd/vet script: - - ./test + - INTEGRATION=y ./test diff --git a/test b/test index 7c16aa2aa..1cf065837 100755 --- a/test +++ b/test @@ -15,8 +15,8 @@ COVER=${COVER:-"-cover"} source ./build # Hack: gofmt ./ will recursively check the .git directory. So use *.go for gofmt. -TESTABLE_AND_FORMATTABLE="client discovery error etcdctl/command etcdmain etcdserver etcdserver/etcdhttp etcdserver/etcdhttp/httptypes integration migrate pkg/fileutil pkg/flags pkg/idutil pkg/ioutil pkg/netutil pkg/pbutil pkg/types pkg/transport pkg/wait proxy raft rafthttp snap store wal" -FORMATTABLE="$TESTABLE_AND_FORMATTABLE *.go etcdctl/" +TESTABLE_AND_FORMATTABLE="client discovery error etcdctl/command etcdmain etcdserver etcdserver/etcdhttp etcdserver/etcdhttp/httptypes migrate pkg/fileutil pkg/flags pkg/idutil pkg/ioutil pkg/netutil pkg/pbutil pkg/types pkg/transport pkg/wait proxy raft rafthttp snap store wal" +FORMATTABLE="$TESTABLE_AND_FORMATTABLE *.go etcdctl/ integration" # user has not provided PKG override if [ -z "$PKG" ]; then @@ -41,6 +41,11 @@ TEST=${split[@]/#/${REPO_PATH}/} echo "Running tests..." go test -timeout 3m ${COVER} $@ ${TEST} --race +if [ -n "$INTEGRATION" ]; then + echo "Running integration tests..." + go test -timeout 3m $@ ${REPO_PATH}/integration +fi + echo "Checking gofmt..." fmtRes=$(gofmt -l $FMT) if [ -n "${fmtRes}" ]; then