Browse Source

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`.
Brian Waldon 11 năm trước cách đây
mục cha
commit
d5f6b97b20
2 tập tin đã thay đổi với 8 bổ sung3 xóa
  1. 1 1
      .travis.yml
  2. 7 2
      test

+ 1 - 1
.travis.yml

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

+ 7 - 2
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