From 92a3f8c365baa6cb8f874759e0b205765db0912e Mon Sep 17 00:00:00 2001 From: Steven Powell Date: Fri, 6 Aug 2021 16:21:57 -0700 Subject: [PATCH] fix not appending .exe to binary --- test/integration/skaffold_test.go | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/test/integration/skaffold_test.go b/test/integration/skaffold_test.go index 2723a87568..f801b6117c 100644 --- a/test/integration/skaffold_test.go +++ b/test/integration/skaffold_test.go @@ -72,8 +72,15 @@ func TestSkaffold(t *testing.T) { t.Fatalf("unable to determine abs path: %v", err) } - if filepath.Base(Target()) != "minikube" { - new := filepath.Join(filepath.Dir(abs), "minikube") + binaryName := "minikube" + pathSeparator := ":" + if runtime.GOOS == "windows" { + binaryName += ".exe" + pathSeparator = ";" + } + + if filepath.Base(Target()) != binaryName { + new := filepath.Join(filepath.Dir(abs), binaryName) t.Logf("copying %s to %s", Target(), new) if err := copy.Copy(Target(), new); err != nil { t.Fatalf("error copying to minikube") @@ -81,10 +88,6 @@ func TestSkaffold(t *testing.T) { } oldPath := os.Getenv("PATH") - pathSeparator := ":" - if runtime.GOOS == "windows" { - pathSeparator = ";" - } os.Setenv("PATH", fmt.Sprintf("%s%s%s", filepath.Dir(abs), pathSeparator, os.Getenv("PATH"))) // make sure 'docker' and 'minikube' are now in PATH