From 89ab1dca02d7ef4a5a981c617ef6304b95dbc4cb Mon Sep 17 00:00:00 2001 From: SoXX Date: Tue, 13 Aug 2024 12:55:06 +0200 Subject: [PATCH] fix(testing): Add lib/pq import and update postgres container setup new version of testing library changed functions --- test/helper.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/helper.go b/test/helper.go index 8cd3a9e..493f7fa 100644 --- a/test/helper.go +++ b/test/helper.go @@ -15,6 +15,7 @@ import ( "gorm.io/gorm" "gorm.io/gorm/logger" + _ "github.com/lib/pq" "github.com/testcontainers/testcontainers-go" "github.com/testcontainers/testcontainers-go/wait" ) @@ -28,8 +29,7 @@ const ( func StartPostgresContainer(ctx context.Context) (*postgrescontainer.PostgresContainer, *gorm.DB, error) { - pgContainer, err := postgrescontainer.RunContainer(ctx, - testcontainers.WithImage("postgres:alpine"), + pgContainer, err := postgrescontainer.Run(ctx, "postgres:alpine", postgrescontainer.WithDatabase(databaseName), postgrescontainer.WithUsername(databaseUser), postgrescontainer.WithPassword(databasePassword),