浏览代码

Fix windows PATH for e2e tests

Guillaume Tardif 5 年之前
父节点
当前提交
5258906ce3
共有 1 个文件被更改,包括 8 次插入1 次删除
  1. 8 1
      tests/framework/suite.go

+ 8 - 1
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 {