From a1729c52de5526e56233182a5875a62f10bed9f3 Mon Sep 17 00:00:00 2001 From: Nicolas De loof Date: Fri, 6 Dec 2024 15:28:38 +0100 Subject: [PATCH] Update pkg/e2e/watch_test.go Co-authored-by: Guillaume Lours <705411+glours@users.noreply.github.com> Signed-off-by: Nicolas De loof Signed-off-by: Nicolas De Loof --- pkg/e2e/watch_test.go | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/pkg/e2e/watch_test.go b/pkg/e2e/watch_test.go index fb5d82543bc..53d9a3ced5e 100644 --- a/pkg/e2e/watch_test.go +++ b/pkg/e2e/watch_test.go @@ -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") }