Skip to content

Commit

Permalink
Remove cleanup from skaffold dev test
Browse files Browse the repository at this point in the history
  • Loading branch information
Priya Wadhwa committed Aug 30, 2018
1 parent 354de8e commit 86c89f4
Showing 1 changed file with 10 additions and 15 deletions.
25 changes: 10 additions & 15 deletions integration/run_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
})
}
}
Expand Down Expand Up @@ -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{
Expand Down

0 comments on commit 86c89f4

Please sign in to comment.