Move PATH setting to occur closer to the exec call
parent
55768061f0
commit
e137ed2e0e
|
|
@ -68,15 +68,6 @@ func TestSkaffold(t *testing.T) {
|
|||
t.Fatalf("unable to determine abs path: %v", err)
|
||||
}
|
||||
|
||||
oldPath := os.Getenv("PATH")
|
||||
os.Setenv("PATH", fmt.Sprintf("%s:%s", filepath.Dir(abs), os.Getenv("PATH")))
|
||||
defer func() {
|
||||
os.Setenv("PATH", oldPath)
|
||||
t.Logf("PATH is now %s", os.Getenv("PATH"))
|
||||
}()
|
||||
|
||||
t.Logf("PATH is now %s", os.Getenv("PATH"))
|
||||
|
||||
if filepath.Base(Target()) != "minikube" {
|
||||
new := filepath.Join(filepath.Dir(abs), "minikube")
|
||||
t.Logf("copying %s to %s", Target(), new)
|
||||
|
|
@ -93,6 +84,12 @@ func TestSkaffold(t *testing.T) {
|
|||
}
|
||||
}
|
||||
|
||||
oldPath := os.Getenv("PATH")
|
||||
os.Setenv("PATH", fmt.Sprintf("%s:%s", filepath.Dir(abs), os.Getenv("PATH")))
|
||||
defer func() {
|
||||
os.Setenv("PATH", oldPath)
|
||||
}()
|
||||
|
||||
// make sure "skaffold run" exits without failure
|
||||
cmd := exec.CommandContext(ctx, tf.Name(), "run", "--minikube-profile", profile, "--kube-context", profile, "--status-check=true", "--port-forward=false")
|
||||
cmd.Dir = "testdata/skaffold"
|
||||
|
|
|
|||
Loading…
Reference in New Issue