github.com/kyma-project/kyma-environment-broker@v0.0.1/internal/storage/driver/postsql/postsql_test.go (about) 1 package postsql_test 2 3 import ( 4 "context" 5 "log" 6 "os" 7 "testing" 8 9 "github.com/kyma-project/kyma-environment-broker/internal/storage" 10 ) 11 12 func TestMain(m *testing.M) { 13 exitVal := 0 14 defer func() { os.Exit(exitVal) }() 15 16 ctx := context.Background() 17 18 cleanupNetwork, err := storage.SetupTestNetworkForDB(ctx) 19 if err != nil { 20 log.Fatal(err) 21 } 22 defer cleanupNetwork() 23 24 containerCleanupFunc, cfg, err := storage.InitTestDBContainer(log.Printf, ctx, "test_DB_1") 25 if err != nil { 26 log.Fatal(err) 27 } 28 defer containerCleanupFunc() 29 30 _, err = storage.SetupTestDBTables(cfg.ConnectionURL()) 31 if err != nil { 32 log.Fatal(err) 33 } 34 35 exitVal = m.Run() 36 }