Skip to content

Commit

Permalink
Try to delineate between unit and integration tests
Browse files Browse the repository at this point in the history
  • Loading branch information
0x6e6562 committed Oct 30, 2014
1 parent eb19378 commit 5188b26
Show file tree
Hide file tree
Showing 12 changed files with 23 additions and 21 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ install:
- go get .

script:
- go test -v -tags unit
- bash -x integration.sh $CASS
- go vet .

Expand Down
2 changes: 2 additions & 0 deletions cass1batch_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// +build all integration

package gocql

import (
Expand Down
4 changes: 1 addition & 3 deletions cassandra_test.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
// Copyright (c) 2012 The gocql Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// +build all integration

package gocql

Expand Down
2 changes: 2 additions & 0 deletions compressor_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// +build all unit

package gocql

import (
Expand Down
10 changes: 4 additions & 6 deletions conn_test.go
Original file line number Diff line number Diff line change
@@ -1,20 +1,18 @@
// Copyright (c) 2012 The gocql Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// +build all unit

package gocql

import (
"crypto/tls"
"crypto/x509"
"io"
"io/ioutil"
"net"
"strings"
"sync"
"sync/atomic"
"testing"
"time"
"crypto/tls"
"crypto/x509"
"io/ioutil"
)

type TestServer struct {
Expand Down
2 changes: 2 additions & 0 deletions errors_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// +build all integration

package gocql

import (
Expand Down
7 changes: 4 additions & 3 deletions integration.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,16 @@ function run_tests() {
ccm start -v
ccm status
ccm node1 nodetool status
ccm node1 showlog > n1_status.log
cat n1_status.log

# ccm node1 showlog > n1_status.log
# cat n1_status.log

local proto=2
if [[ $version == 1.2.* ]]; then
proto=1
fi

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

cat results
cover=`cat results | grep coverage: | grep -o "[0-9]\{1,3\}" | head -n 1`
Expand Down
2 changes: 2 additions & 0 deletions marshal_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// +build all unit

package gocql

import (
Expand Down
2 changes: 2 additions & 0 deletions session_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// +build all integration

package gocql

import (
Expand Down
4 changes: 1 addition & 3 deletions topology_test.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
// Copyright (c) 2012 The gocql Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// +build all unit

package gocql

Expand Down
4 changes: 1 addition & 3 deletions uuid_test.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
// Copyright (c) 2012 The gocql Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// +build all unit

package gocql

Expand Down
4 changes: 1 addition & 3 deletions wiki_test.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
// Copyright (c) 2014 The gocql Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// +build all integration

package gocql

Expand Down

0 comments on commit 5188b26

Please sign in to comment.