(ctx context.Context, env *testEnvironment)
| 262 | } |
| 263 | |
| 264 | func existingEnvironment(ctx context.Context, env *testEnvironment) (bool, error) { |
| 265 | toxiproxyAddr, ok := os.LookupEnv("TOXIPROXY_ADDR") |
| 266 | if !ok { |
| 267 | return false, nil |
| 268 | } |
| 269 | toxiproxyURL, err := url.Parse(toxiproxyAddr) |
| 270 | if err != nil { |
| 271 | return false, fmt.Errorf("$TOXIPROXY_ADDR not parseable as url") |
| 272 | } |
| 273 | if err := setupToxiProxies(env, toxiproxyURL.String()); err != nil { |
| 274 | return false, fmt.Errorf("failed to setup toxiproxies: %w", err) |
| 275 | } |
| 276 | |
| 277 | env.KafkaVersion, ok = os.LookupEnv("KAFKA_VERSION") |
| 278 | if !ok { |
| 279 | return false, fmt.Errorf("KAFKA_VERSION needs to be provided with TOXIPROXY_ADDR") |
| 280 | } |
| 281 | return true, nil |
| 282 | } |
| 283 | |
| 284 | func tearDownDockerTestEnvironment(ctx context.Context, env *testEnvironment) error { |
| 285 | args := []string{"compose", "down", "--volumes"} |
no test coverage detected