Skip to content

Commit

Permalink
Update to new API
Browse files Browse the repository at this point in the history
  • Loading branch information
streamer45 committed Aug 6, 2024
1 parent 4ebed5d commit f260232
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions server/testutils/containers.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ func RunPostgresContainerLocal(ctx context.Context) (string, func(), error) {
// RunPostgresContainer creates and runs a postgres container
func RunPostgresContainer(ctx context.Context, opts ...tc.ContainerCustomizer) (*postgres.PostgresContainer, func(), error) {
opts = append([]tc.ContainerCustomizer{
tc.WithImage(PostgresImage),
postgres.WithDatabase(DBName),
postgres.WithUsername(DBUser),
postgres.WithPassword(DBPass),
Expand All @@ -63,7 +62,7 @@ func RunPostgresContainer(ctx context.Context, opts ...tc.ContainerCustomizer) (
WithStartupTimeout(15 * time.Second)),
}, opts...)

cnt, err := postgres.RunContainer(ctx, opts...)
cnt, err := postgres.Run(ctx, PostgresImage, opts...)
if err != nil {
return nil, nil, fmt.Errorf("failed to run container: %w", err)
}
Expand All @@ -78,13 +77,12 @@ func RunPostgresContainer(ctx context.Context, opts ...tc.ContainerCustomizer) (
// RunMySQLContainer creates and runs a mysql container
func RunMySQLContainer(ctx context.Context, opts ...tc.ContainerCustomizer) (*mysql.MySQLContainer, func(), error) {
opts = append([]tc.ContainerCustomizer{
tc.WithImage(MySQLImage),
mysql.WithDatabase(DBName),
mysql.WithUsername(DBUser),
mysql.WithPassword(DBPass),
}, opts...)

cnt, err := mysql.RunContainer(ctx, opts...)
cnt, err := mysql.Run(ctx, MySQLImage, opts...)
if err != nil {
return nil, nil, fmt.Errorf("failed to run container: %w", err)
}
Expand Down

0 comments on commit f260232

Please sign in to comment.