GetTestPgContainer is a helper function for tests that creates a PostgreSQL container and handles the error by failing the test if container creation fails
(ctx context.Context, t testing.TB)
| 187 | // GetTestPgContainer is a helper function for tests that creates a PostgreSQL container |
| 188 | // and handles the error by failing the test if container creation fails |
| 189 | func GetTestPgContainer(ctx context.Context, t testing.TB) *Container { |
| 190 | t.Helper() |
| 191 | container, err := GetPgContainer(ctx) |
| 192 | if err != nil { |
| 193 | t.Fatalf("failed to create PostgreSQL container: %v", err) |
| 194 | } |
| 195 | return container |
| 196 | } |
| 197 | |
| 198 | // GetTestPg17Container creates a PostgreSQL 17 container for testing, failing the |
| 199 | // test on error. |