Skip to content

Commit

Permalink
nit
Browse files Browse the repository at this point in the history
  • Loading branch information
sudiptob2 committed Nov 15, 2024
1 parent 9e175d5 commit bbaf8f4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion internal/database/repository/repo_int_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ func (ts *RepositoryTestSuite) SetupSuite() {
Password: "test",
DBName: "template",
Host: "localhost",
Port: "15433",
Port: 15433,
}

tp, err := database.NewTestPostgresContainer(ctx, cfg)
Expand Down
6 changes: 3 additions & 3 deletions test/database/postgres.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ type InstanceConfig struct {
Password string
DBName string
Host string
Port string
Port int
}

func (c InstanceConfig) DBConnStr() string {
s := fmt.Sprintf("postgres://%s:%s@%s:%s/%s?sslmode=disable", c.User, c.Password, c.Host, c.Port, c.DBName)
s := fmt.Sprintf("postgres://%s:%s@%s:%d/%s?sslmode=disable", c.User, c.Password, c.Host, c.Port, c.DBName)
return s
}

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

func NewTestPostgresContainer(ctx context.Context, cfg InstanceConfig) (*TestPostgresContainer, error) {
port := fmt.Sprintf("%s:5432/tcp", cfg.Port)
port := fmt.Sprintf("%d:5432/tcp", cfg.Port)
cr := testcontainers.ContainerRequest{
Image: "postgres:16.0-bookworm", // TODO: change to correct version
Env: map[string]string{
Expand Down

0 comments on commit bbaf8f4

Please sign in to comment.