(t *testing.T)
| 448 | } |
| 449 | |
| 450 | func TestWatchIncludes(t *testing.T) { |
| 451 | c := NewCLI(t) |
| 452 | const projectName = "test_watch_includes" |
| 453 | |
| 454 | defer c.cleanupWithDown(t, projectName) |
| 455 | |
| 456 | tmpdir := t.TempDir() |
| 457 | composeFilePath := filepath.Join(tmpdir, "compose.yaml") |
| 458 | CopyFile(t, filepath.Join("fixtures", "watch", "include.yaml"), composeFilePath) |
| 459 | |
| 460 | cmd := c.NewDockerComposeCmd(t, "-p", projectName, "-f", composeFilePath, "up", "--watch") |
| 461 | buffer := bytes.NewBuffer(nil) |
| 462 | cmd.Stdout = buffer |
| 463 | watch := icmd.StartCmd(cmd) |
| 464 | |
| 465 | poll.WaitOn(t, func(l poll.LogT) poll.Result { |
| 466 | if strings.Contains(watch.Stdout(), "Attaching to ") { |
| 467 | return poll.Success() |
| 468 | } |
| 469 | return poll.Continue("%v", watch.Stdout()) |
| 470 | }) |
| 471 | |
| 472 | assert.NilError(t, os.WriteFile(filepath.Join(tmpdir, "B.test"), []byte("test"), 0o600)) |
| 473 | assert.NilError(t, os.WriteFile(filepath.Join(tmpdir, "A.test"), []byte("test"), 0o600)) |
| 474 | |
| 475 | poll.WaitOn(t, func(l poll.LogT) poll.Result { |
| 476 | cat := c.RunDockerComposeCmdNoCheck(t, "-p", projectName, "exec", "a", "ls", "/data/") |
| 477 | if strings.Contains(cat.Stdout(), "A.test") { |
| 478 | assert.Check(t, !strings.Contains(cat.Stdout(), "B.test")) |
| 479 | return poll.Success() |
| 480 | } |
| 481 | return poll.Continue("%v", cat.Combined()) |
| 482 | }) |
| 483 | |
| 484 | c.RunDockerComposeCmdNoCheck(t, "-p", projectName, "kill", "-s", "9") |
| 485 | } |
| 486 | |
| 487 | func TestCheckWarningXInitialSyn(t *testing.T) { |
| 488 | c := NewCLI(t) |
nothing calls this directly
no test coverage detected