MCPcopy Index your code
hub / github.com/bytebase/bytebase / GetTestPgContainer

Function GetTestPgContainer

backend/common/testcontainer/testcontainer.go:189–196  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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
189func 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.

Calls 2

GetPgContainerFunction · 0.85
FatalfMethod · 0.80