Merge pull request #9113 from tstromberg/skaffold-tests

Fix 'minikube is not in path' error
pull/9127/head^2
Thomas Strömberg 2020-08-28 13:08:20 -07:00 committed by GitHub
commit a8b40a704b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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)
}()