Skip to content

Commit

Permalink
fix integration tests
Browse files Browse the repository at this point in the history
  • Loading branch information
rafaeljesus committed Mar 6, 2018
1 parent 957a013 commit 0822b78
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
11 changes: 6 additions & 5 deletions features/mysql_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"os"
"path"
"testing"
"time"

"github.com/go-sql-driver/mysql"
"github.com/hellofresh/klepto/pkg/config"
Expand All @@ -19,15 +20,15 @@ import (

type MysqlTestSuite struct {
suite.Suite

rootDSN string
rootConnection *sql.DB

databases []string
databases []string
timeout time.Duration
}

func TestMysqlTestSuite(t *testing.T) {
suite.Run(t, new(MysqlTestSuite))
s := &MysqlTestSuite{timeout: time.Second * 3}
suite.Run(t, s)
}

func (s *MysqlTestSuite) TestExample() {
Expand All @@ -36,7 +37,7 @@ func (s *MysqlTestSuite) TestExample() {

s.loadFixture(readDSN, "mysql_simple.sql")

rdr, err := reader.Connect(reader.ConnOpts{DSN: readDSN})
rdr, err := reader.Connect(reader.ConnOpts{DSN: readDSN, Timeout: s.timeout})
s.Require().NoError(err, "Unable to create reader")
defer rdr.Close()

Expand Down
11 changes: 6 additions & 5 deletions features/postgres_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"os"
"path"
"testing"
"time"

"strconv"

Expand All @@ -21,11 +22,10 @@ import (

type PostgresTestSuite struct {
suite.Suite

rootDSN string
rootConnection *sql.DB

databases []string
databases []string
timeout time.Duration
}

type tableInfo struct {
Expand All @@ -35,7 +35,8 @@ type tableInfo struct {
}

func TestPostgresTestSuite(t *testing.T) {
suite.Run(t, new(PostgresTestSuite))
s := &PostgresTestSuite{timeout: time.Second * 3}
suite.Run(t, s)
}

func (s *PostgresTestSuite) TestExample() {
Expand All @@ -44,7 +45,7 @@ func (s *PostgresTestSuite) TestExample() {

s.loadFixture(readDSN, "pg_simple.sql")

rdr, err := reader.Connect(reader.ConnOpts{DSN: readDSN})
rdr, err := reader.Connect(reader.ConnOpts{DSN: readDSN, Timeout: s.timeout})
s.Require().NoError(err, "Unable to create reader")
defer rdr.Close()

Expand Down

0 comments on commit 0822b78

Please sign in to comment.