From 5258906ce37dfacf924b109207a154145f1202f8 Mon Sep 17 00:00:00 2001 From: Guillaume Tardif Date: Mon, 8 Jun 2020 21:52:34 +0200 Subject: [PATCH] Fix windows PATH for e2e tests --- tests/framework/suite.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/tests/framework/suite.go b/tests/framework/suite.go index 8a33b2f90..91b7e3d2a 100644 --- a/tests/framework/suite.go +++ b/tests/framework/suite.go @@ -91,10 +91,17 @@ func (s *Suite) copyExecutablesInBinDir() { gomega.Expect(err).To(gomega.BeNil()) err = copyFile(dockerPath, filepath.Join(s.BinDir, dockerExecutable())) gomega.Expect(err).To(gomega.BeNil()) - err = os.Setenv("PATH", fmt.Sprintf("%s:%s", s.BinDir, os.Getenv("PATH"))) + err = os.Setenv("PATH", concatenatePath(s.BinDir)) gomega.Expect(err).To(gomega.BeNil()) } +func concatenatePath(path string) string { + if IsWindows() { + return fmt.Sprintf("%s;%s", path, os.Getenv("PATH")) + } + return fmt.Sprintf("%s:%s", path, os.Getenv("PATH")) +} + func copyFile(sourceFile string, destinationFile string) error { input, err := ioutil.ReadFile(sourceFile) if err != nil {