(ctx context.Context, container testcontainers.Container)
| 37 | } |
| 38 | |
| 39 | func 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 | |
| 59 | func newTestMigrationContext() *base.MigrationContext { |
| 60 | migrationContext := base.NewMigrationContext() |
searching dependent graphs…