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`.
release-2.0
Brian Waldon 2015-01-22 17:29:31 -08:00
parent 6b304ce605
commit d5f6b97b20
2 changed files with 8 additions and 3 deletions

View File

@ -8,4 +8,4 @@ install:
- go get code.google.com/p/go.tools/cmd/vet
script:
- ./test
- INTEGRATION=y ./test

9
test
View File

@ -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