MCPcopy Create free account
hub / github.com/bytebase/bytebase / GetTestMongoDBContainer

Function GetTestMongoDBContainer

backend/common/testcontainer/testcontainer.go:607–614  ·  view source on GitHub ↗

GetTestMongoDBContainer is a helper function for tests that creates a MongoDB 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

605// GetTestMongoDBContainer is a helper function for tests that creates a MongoDB container
606// and handles the error by failing the test if container creation fails
607func GetTestMongoDBContainer(ctx context.Context, t testing.TB) *MongoDBContainer {
608 t.Helper()
609 container, err := GetMongoDBContainer(ctx)
610 if err != nil {
611 t.Fatalf("failed to create MongoDB container: %v", err)
612 }
613 return container
614}

Calls 2

GetMongoDBContainerFunction · 0.85
FatalfMethod · 0.80