test: simplify setup
This commit is contained in:
parent
229b7bf53e
commit
93650d7d5a
1 changed files with 0 additions and 9 deletions
|
@ -19,17 +19,8 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
func setupPostgres(ctx context.Context, t *testing.T) *postgres.PostgresContainer {
|
func setupPostgres(ctx context.Context, t *testing.T) *postgres.PostgresContainer {
|
||||||
|
|
||||||
dbName := "users"
|
|
||||||
dbUser := "user"
|
|
||||||
dbPassword := "password"
|
|
||||||
|
|
||||||
postgresContainer, err := postgres.RunContainer(ctx,
|
postgresContainer, err := postgres.RunContainer(ctx,
|
||||||
testcontainers.WithImage("docker.io/postgres:15.2-alpine"),
|
testcontainers.WithImage("docker.io/postgres:15.2-alpine"),
|
||||||
postgres.WithDatabase(dbName),
|
|
||||||
postgres.WithUsername(dbUser),
|
|
||||||
postgres.WithPassword(dbPassword),
|
|
||||||
|
|
||||||
testcontainers.WithWaitStrategy(
|
testcontainers.WithWaitStrategy(
|
||||||
wait.ForLog("database system is ready to accept connections").
|
wait.ForLog("database system is ready to accept connections").
|
||||||
WithOccurrence(2).
|
WithOccurrence(2).
|
||||||
|
|
Reference in a new issue