diff --git a/integration/run_test.go b/integration/run_test.go index c6aaf501364..c4fd79962ca 100644 --- a/integration/run_test.go +++ b/integration/run_test.go @@ -193,7 +193,15 @@ func TestRun(t *testing.T) { } // Cleanup - cleanupTest(t, ns, testCase.dir, testCase.filename) + args = []string{"delete", "--namespace", ns.Name} + if testCase.filename != "" { + args = append(args, "-f", testCase.filename) + } + cmd = exec.Command("skaffold", args...) + cmd.Dir = testCase.dir + if output, err := util.RunCmdOut(cmd); err != nil { + t.Fatalf("skaffold delete: %s %v", output, err) + } }) } } @@ -285,24 +293,11 @@ func TestDev(t *testing.T) { } } - // Cleanup - cleanupTest(t, ns, testCase.dir, "") + // No cleanup, since exiting skaffold dev should clean up automatically }) } } -func cleanupTest(t *testing.T, ns *v1.Namespace, dir, filename string) { - args := []string{"delete", "--namespace", ns.Name} - if filename != "" { - args = append(args, "-f", filename) - } - cmd := exec.Command("skaffold", args...) - cmd.Dir = dir - if output, err := util.RunCmdOut(cmd); err != nil { - t.Fatalf("skaffold delete: %s %v", output, err) - } -} - func setupNamespace(t *testing.T) (*v1.Namespace, func()) { ns, err := client.CoreV1().Namespaces().Create(&v1.Namespace{ ObjectMeta: meta_v1.ObjectMeta{