Fix 'minikube is not in path' error

pull/9113/head
Thomas Stromberg 2020-08-28 11:22:19 -07:00
parent c25a2e645c
commit c082e5eb98
1 changed files with 4 additions and 3 deletions

View File

@ -76,7 +76,10 @@ func TestSkaffold(t *testing.T) {
}
}
// make sure 'docker' and 'minikube' are on PATH
oldPath := os.Getenv("PATH")
os.Setenv("PATH", fmt.Sprintf("%s:%s", filepath.Dir(abs), os.Getenv("PATH")))
// make sure 'docker' and 'minikube' are now in PATH
for _, binary := range []string{"minikube", "docker"} {
_, err := exec.LookPath(binary)
if err != nil {
@ -84,8 +87,6 @@ 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)
}()