فهرست منبع

Disable coverage check in integration suite

Enable race detector, dont use cover profile.
Add flag for timeout.
Chris Bannister 10 سال پیش
والد
کامیت
65085c9eb4
3فایلهای تغییر یافته به همراه4 افزوده شده و 10 حذف شده
  1. 1 1
      .travis.yml
  2. 2 1
      cassandra_test.go
  3. 1 8
      integration.sh

+ 1 - 1
.travis.yml

@@ -39,7 +39,7 @@ install:
 script:
 script:
   - set -e
   - set -e
   - go test -v -tags unit
   - go test -v -tags unit
-  - PATH=$PATH:$HOME/.local/bin bash -x integration.sh $CASS $AUTH
+  - PATH=$PATH:$HOME/.local/bin bash integration.sh $CASS $AUTH
   - go vet .
   - go vet .
 
 
 notifications:
 notifications:

+ 2 - 1
cassandra_test.go

@@ -32,6 +32,7 @@ var (
 	flagRunSslTest   = flag.Bool("runssl", false, "Set to true to run ssl test")
 	flagRunSslTest   = flag.Bool("runssl", false, "Set to true to run ssl test")
 	flagRunAuthTest  = flag.Bool("runauth", false, "Set to true to run authentication test")
 	flagRunAuthTest  = flag.Bool("runauth", false, "Set to true to run authentication test")
 	flagCompressTest = flag.String("compressor", "", "compressor to use")
 	flagCompressTest = flag.String("compressor", "", "compressor to use")
+	flagTimeout      = flag.Duration("gocql.timeout", 5*time.Second, "sets the connection `timeout` for all operations")
 	clusterHosts     []string
 	clusterHosts     []string
 )
 )
 
 
@@ -73,7 +74,7 @@ func createCluster() *ClusterConfig {
 	cluster := NewCluster(clusterHosts...)
 	cluster := NewCluster(clusterHosts...)
 	cluster.ProtoVersion = *flagProto
 	cluster.ProtoVersion = *flagProto
 	cluster.CQLVersion = *flagCQL
 	cluster.CQLVersion = *flagCQL
-	cluster.Timeout = 5 * time.Second
+	cluster.Timeout = *flagTimeout
 	cluster.Consistency = Quorum
 	cluster.Consistency = Quorum
 	if *flagRetry > 0 {
 	if *flagRetry > 0 {
 		cluster.RetryPolicy = &SimpleRetryPolicy{NumRetries: *flagRetry}
 		cluster.RetryPolicy = &SimpleRetryPolicy{NumRetries: *flagRetry}

+ 1 - 8
integration.sh

@@ -61,7 +61,7 @@ function run_tests() {
     	go test -v . -timeout 15s -run=TestAuthentication -tags integration -runssl -runauth -proto=$proto -cluster=$(ccm liveset) -clusterSize=$clusterSize -autowait=1000ms
     	go test -v . -timeout 15s -run=TestAuthentication -tags integration -runssl -runauth -proto=$proto -cluster=$(ccm liveset) -clusterSize=$clusterSize -autowait=1000ms
 	else
 	else
 
 
-		go test -timeout 5m -tags integration -cover -v -runssl -proto=$proto -rf=3 -cluster=$(ccm liveset) -clusterSize=$clusterSize -autowait=2000ms -compressor=snappy ./... | tee results.txt
+		go test -timeout 5m -race -tags integration -v -gocql.timeout=10s -runssl -proto=$proto -rf=3 -cluster=$(ccm liveset) -clusterSize=$clusterSize -autowait=2000ms -compressor=snappy ./...
 
 
 		if [ ${PIPESTATUS[0]} -ne 0 ]; then
 		if [ ${PIPESTATUS[0]} -ne 0 ]; then
 			echo "--- FAIL: ccm status follows:"
 			echo "--- FAIL: ccm status follows:"
@@ -72,13 +72,6 @@ function run_tests() {
 			echo "--- FAIL: Received a non-zero exit code from the go test execution, please investigate this"
 			echo "--- FAIL: Received a non-zero exit code from the go test execution, please investigate this"
 			exit 1
 			exit 1
 		fi
 		fi
-
-		cover=`cat results.txt | grep coverage: | grep -o "[0-9]\{1,3\}" | head -n 1`
-
-		if [[ $cover -lt "55" ]]; then
-			echo "--- FAIL: expected coverage of at least 60 %, but coverage was $cover %"
-			exit 1
-		fi
 	fi
 	fi
 
 
 	ccm remove
 	ccm remove