Skip to content

Commit

Permalink
fix(pgtesting): wrong username/password used
Browse files Browse the repository at this point in the history
  • Loading branch information
gfyrag committed Dec 13, 2022
1 parent d251947 commit ef2d525
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pgtesting/pkg/postgres.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,12 @@ type pgServer struct {
lock sync.Mutex
conn *pgx.Conn
port string
config config
}

func (s *pgServer) dsn(databaseName string) string {
return fmt.Sprintf("postgresql://root:root@localhost:%s/%s?sslmode=disable", s.port, databaseName)
return fmt.Sprintf("postgresql://%s:%s@localhost:%s/%s?sslmode=disable", s.config.initialUsername,
s.config.initialUserPassword, s.port, databaseName)
}

func (s *pgServer) NewDatabase(t *testing.T) *pgDatabase {
Expand Down Expand Up @@ -178,6 +180,7 @@ func CreatePostgresServer(opts ...option) error {
destroy: func() error {
return pool.Purge(resource)
},
config: cfg,
}

try := time.Duration(0)
Expand Down

0 comments on commit ef2d525

Please sign in to comment.