(t *testing.T)
| 344 | } |
| 345 | |
| 346 | func TestComposeFileSetByEnvFile(t *testing.T) { |
| 347 | c := NewCLI(t) |
| 348 | defer c.cleanupWithDown(t, "dotenv") |
| 349 | |
| 350 | dotEnv, err := os.CreateTemp(t.TempDir(), ".env") |
| 351 | assert.NilError(t, err) |
| 352 | err = os.WriteFile(dotEnv.Name(), []byte(` |
| 353 | COMPOSE_FILE=fixtures/dotenv/development/compose.yaml |
| 354 | IMAGE_NAME=test |
| 355 | IMAGE_TAG=latest |
| 356 | COMPOSE_PROFILES=test |
| 357 | `), 0o700) |
| 358 | assert.NilError(t, err) |
| 359 | |
| 360 | cmd := c.NewDockerComposeCmd(t, "--env-file", dotEnv.Name(), "config") |
| 361 | res := icmd.RunCmd(cmd) |
| 362 | res.Assert(t, icmd.Expected{ |
| 363 | Out: "image: test:latest", |
| 364 | }) |
| 365 | res.Assert(t, icmd.Expected{ |
| 366 | Out: "image: enabled:profile", |
| 367 | }) |
| 368 | } |
| 369 | |
| 370 | func TestNestedDotEnv(t *testing.T) { |
| 371 | c := NewCLI(t) |
nothing calls this directly
no test coverage detected