Explorar el Código

Disable coverage check in integration suite

Enable race detector, dont use cover profile.
Add flag for timeout.
Chris Bannister hace 10 años
padre
commit
65085c9eb4
Se han modificado 3 ficheros con 4 adiciones y 10 borrados
  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:
   - set -e
   - 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 .
 
 notifications:

+ 2 - 1
cassandra_test.go

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