MCPcopy
hub / github.com/github/gh-ost / getTestConnectionConfig

Function getTestConnectionConfig

go/logic/test_utils.go:39–57  ·  view source on GitHub ↗
(ctx context.Context, container testcontainers.Container)

Source from the content-addressed store, hash-verified

37}
38
39func getTestConnectionConfig(ctx context.Context, container testcontainers.Container) (*mysql.ConnectionConfig, error) {
40 host, err := container.Host(ctx)
41 if err != nil {
42 return nil, err
43 }
44
45 port, err := container.MappedPort(ctx, "3306")
46 if err != nil {
47 return nil, err
48 }
49
50 connectionConfig := mysql.NewConnectionConfig()
51 connectionConfig.Key.Hostname = host
52 connectionConfig.Key.Port = port.Int()
53 connectionConfig.User = testMysqlUser
54 connectionConfig.Password = testMysqlPass
55
56 return connectionConfig, nil
57}
58
59func newTestMigrationContext() *base.MigrationContext {
60 migrationContext := base.NewMigrationContext()

Calls 1

NewConnectionConfigFunction · 0.92

Used in the wild real call sites across dependent graphs

searching dependent graphs…