Skip to content

Commit

Permalink
Updated SetUpCassandraDatabase to take an actual logger instead of cr…
Browse files Browse the repository at this point in the history
…eating a NoopLogger. (#2453)
  • Loading branch information
Jason Roselander authored Feb 2, 2022
1 parent 3eb7730 commit 515900d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion common/persistence/tests/cassandra_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ func setUpCassandraTest(t *testing.T) (cassandraTestData, func()) {
var testData cassandraTestData
testData.cfg = newCassandraConfig()
testData.logger = log.NewZapLogger(zaptest.NewLogger(t))
SetUpCassandraDatabase(testData.cfg)
SetUpCassandraDatabase(testData.cfg, testData.logger)
SetUpCassandraSchema(testData.cfg, testData.logger)

testData.factory = cassandra.NewFactory(
Expand Down
4 changes: 2 additions & 2 deletions common/persistence/tests/cassandra_test_util.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,12 @@ const (
testCassandraVisibilitySchema = "../../../schema/cassandra/visibility/schema.cql"
)

func SetUpCassandraDatabase(cfg *config.Cassandra) {
func SetUpCassandraDatabase(cfg *config.Cassandra, logger log.Logger) {
adminCfg := *cfg
// NOTE need to connect with empty name to create new database
adminCfg.Keyspace = "system"

session, err := gocql.NewSession(adminCfg, resolver.NewNoopResolver(), log.NewNoopLogger())
session, err := gocql.NewSession(adminCfg, resolver.NewNoopResolver(), logger)
if err != nil {
panic(fmt.Sprintf("unable to create Cassandra session: %v", err))
}
Expand Down

0 comments on commit 515900d

Please sign in to comment.