Merge pull request #12155 from spowelljr/fixTestSkaffold
Fix not appending .exe to binary `TestSkaffold`pull/12142/head
commit
30065ae49a
|
@ -72,8 +72,15 @@ func TestSkaffold(t *testing.T) {
|
||||||
t.Fatalf("unable to determine abs path: %v", err)
|
t.Fatalf("unable to determine abs path: %v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if filepath.Base(Target()) != "minikube" {
|
binaryName := "minikube"
|
||||||
new := filepath.Join(filepath.Dir(abs), "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)
|
t.Logf("copying %s to %s", Target(), new)
|
||||||
if err := copy.Copy(Target(), new); err != nil {
|
if err := copy.Copy(Target(), new); err != nil {
|
||||||
t.Fatalf("error copying to minikube")
|
t.Fatalf("error copying to minikube")
|
||||||
|
@ -81,10 +88,6 @@ func TestSkaffold(t *testing.T) {
|
||||||
}
|
}
|
||||||
|
|
||||||
oldPath := os.Getenv("PATH")
|
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")))
|
os.Setenv("PATH", fmt.Sprintf("%s%s%s", filepath.Dir(abs), pathSeparator, os.Getenv("PATH")))
|
||||||
|
|
||||||
// make sure 'docker' and 'minikube' are now in PATH
|
// make sure 'docker' and 'minikube' are now in PATH
|
||||||
|
|
Loading…
Reference in New Issue