Skip to content

Commit 5188b26

Browse files
committed
Try to delineate between unit and integration tests
1 parent eb19378 commit 5188b26

12 files changed

+23
-21
lines changed

.travis.yml

+1
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ install:
2525
- go get .
2626

2727
script:
28+
- go test -v -tags unit
2829
- bash -x integration.sh $CASS
2930
- go vet .
3031

cass1batch_test.go

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// +build all integration
2+
13
package gocql
24

35
import (

cassandra_test.go

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
// Copyright (c) 2012 The gocql Authors. All rights reserved.
2-
// Use of this source code is governed by a BSD-style
3-
// license that can be found in the LICENSE file.
1+
// +build all integration
42

53
package gocql
64

compressor_test.go

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// +build all unit
2+
13
package gocql
24

35
import (

conn_test.go

+4-6
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,18 @@
1-
// Copyright (c) 2012 The gocql Authors. All rights reserved.
2-
// Use of this source code is governed by a BSD-style
3-
// license that can be found in the LICENSE file.
1+
// +build all unit
42

53
package gocql
64

75
import (
6+
"crypto/tls"
7+
"crypto/x509"
88
"io"
9+
"io/ioutil"
910
"net"
1011
"strings"
1112
"sync"
1213
"sync/atomic"
1314
"testing"
1415
"time"
15-
"crypto/tls"
16-
"crypto/x509"
17-
"io/ioutil"
1816
)
1917

2018
type TestServer struct {

errors_test.go

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// +build all integration
2+
13
package gocql
24

35
import (

integration.sh

+4-3
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,16 @@ function run_tests() {
1515
ccm start -v
1616
ccm status
1717
ccm node1 nodetool status
18-
ccm node1 showlog > n1_status.log
19-
cat n1_status.log
18+
19+
# ccm node1 showlog > n1_status.log
20+
# cat n1_status.log
2021

2122
local proto=2
2223
if [[ $version == 1.2.* ]]; then
2324
proto=1
2425
fi
2526

26-
go test -cover -v -runssl -proto=$proto -rf=3 -cluster=$(ccm liveset) -clusterSize=$clusterSize -autowait=2000ms ./... > results
27+
go test -tags integration -cover -v -runssl -proto=$proto -rf=3 -cluster=$(ccm liveset) -clusterSize=$clusterSize -autowait=2000ms ./... > results
2728

2829
cat results
2930
cover=`cat results | grep coverage: | grep -o "[0-9]\{1,3\}" | head -n 1`

marshal_test.go

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// +build all unit
2+
13
package gocql
24

35
import (

session_test.go

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// +build all integration
2+
13
package gocql
24

35
import (

topology_test.go

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
// Copyright (c) 2012 The gocql Authors. All rights reserved.
2-
// Use of this source code is governed by a BSD-style
3-
// license that can be found in the LICENSE file.
1+
// +build all unit
42

53
package gocql
64

uuid_test.go

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
// Copyright (c) 2012 The gocql Authors. All rights reserved.
2-
// Use of this source code is governed by a BSD-style
3-
// license that can be found in the LICENSE file.
1+
// +build all unit
42

53
package gocql
64

wiki_test.go

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
// Copyright (c) 2014 The gocql Authors. All rights reserved.
2-
// Use of this source code is governed by a BSD-style
3-
// license that can be found in the LICENSE file.
1+
// +build all integration
42

53
package gocql
64

0 commit comments

Comments
 (0)