Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
mgdelacroix committed Mar 17, 2023
1 parent 5130779 commit 21d3c7b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
2 changes: 2 additions & 0 deletions server/channels/store/sqlstore/store_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -761,6 +761,8 @@ func TestReplicaLagQuery(t *testing.T) {
}

func makeSqlSettings(driver string) *model.SqlSettings {
fmt.Printf("!!!!!! makeSqlSettings with driver=%s\n", driver)

switch driver {
case model.DatabaseDriverPostgres:
return storetest.MakeSqlSettings(driver, false)
Expand Down
7 changes: 7 additions & 0 deletions server/channels/store/storetest/settings.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ func log(message string) {
// The database name is generated randomly and must be created before use.
func MySQLSettings(withReplica bool) *model.SqlSettings {
dsn := os.Getenv("TEST_DATABASE_MYSQL_DSN")

fmt.Printf("!!!!!! MySQLSettings with TEST_DATABASE_MYSQL_DSN=%s\n", dsn)
if dsn == "" {
dsn = defaultMysqlDSN
mlog.Info("No TEST_DATABASE_MYSQL_DSN override, using default", mlog.String("default_dsn", dsn))
Expand Down Expand Up @@ -84,6 +86,9 @@ func MySQLSettings(withReplica bool) *model.SqlSettings {
// The database name is generated randomly and must be created before use.
func PostgreSQLSettings() *model.SqlSettings {
dsn := os.Getenv("TEST_DATABASE_POSTGRESQL_DSN")

fmt.Printf("!!!!!! PostgreSQLSettings with TEST_DATABASE_POSTGRESQL_DSN=%s\n", dsn)

if dsn == "" {
dsn = defaultPostgresqlDSN
mlog.Info("No TEST_DATABASE_POSTGRESQL_DSN override, using default", mlog.String("default_dsn", dsn))
Expand Down Expand Up @@ -224,6 +229,7 @@ func MakeSqlSettings(driver string, withReplica bool) *model.SqlSettings {

switch driver {
case model.DatabaseDriverMysql:
fmt.Printf("!!!!!! About to MakeSqlSettings on MySQL with driver=%s\n", driver)
settings = MySQLSettings(withReplica)
dbName = mySQLDSNDatabase(*settings.DataSource)
newDSRs := []string{}
Expand All @@ -232,6 +238,7 @@ func MakeSqlSettings(driver string, withReplica bool) *model.SqlSettings {
}
settings.DataSourceReplicas = newDSRs
case model.DatabaseDriverPostgres:
fmt.Printf("!!!!!! About to MakeSqlSettings on Postgres with driver=%s\n", driver)
settings = PostgreSQLSettings()
dbName = postgreSQLDSNDatabase(*settings.DataSource)
default:
Expand Down

0 comments on commit 21d3c7b

Please sign in to comment.