Update pkg/e2e/watch_test.go

Co-authored-by: Guillaume Lours <705411+glours@users.noreply.github.com>
Signed-off-by: Nicolas De loof <nicolas.deloof@gmail.com>
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
This commit is contained in:
Nicolas De loof 2024-12-06 15:28:38 +01:00
parent 254224c182
commit a1729c52de
1 changed files with 4 additions and 6 deletions

View File

@ -292,17 +292,15 @@ func doTest(t *testing.T, svcName string) {
}
func TestWatchExec(t *testing.T) {
cli := NewCLI(t)
c := NewCLI(t)
const projectName = "test_watch_exec"
t.Cleanup(func() {
cli.RunDockerComposeCmd(t, "-p", projectName, "down")
})
defer c.cleanupWithDown(t, projectName)
tmpdir := t.TempDir()
composeFilePath := filepath.Join(tmpdir, "compose.yaml")
CopyFile(t, filepath.Join("fixtures", "watch", "exec.yaml"), composeFilePath)
cmd := cli.NewDockerComposeCmd(t, "-p", projectName, "-f", composeFilePath, "up", "--watch")
cmd := c.NewDockerComposeCmd(t, "-p", projectName, "-f", composeFilePath, "up", "--watch")
buffer := bytes.NewBuffer(nil)
cmd.Stdout = buffer
watch := icmd.StartCmd(cmd)
@ -327,5 +325,5 @@ func TestWatchExec(t *testing.T) {
}
return poll.Continue("%v", out)
})
cli.RunDockerComposeCmdNoCheck(t, "-p", projectName, "kill", "-s", "9")
c.RunDockerComposeCmdNoCheck(t, "-p", projectName, "kill", "-s", "9")
}