From 6e99119a4b64848e9351888e90d7e61dab08b78a Mon Sep 17 00:00:00 2001 From: Chris Crone Date: Mon, 10 Aug 2020 14:26:47 +0200 Subject: [PATCH] tests.e2e: Fix Windows tests Signed-off-by: Chris Crone --- tests/e2e/e2e_test.go | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/tests/e2e/e2e_test.go b/tests/e2e/e2e_test.go index cd24b8700..c7ac646f0 100644 --- a/tests/e2e/e2e_test.go +++ b/tests/e2e/e2e_test.go @@ -259,8 +259,16 @@ func TestMissingExistingCLI(t *testing.T) { err = CopyFile(filepath.Join(binDir, DockerExecutableName), filepath.Join(bin, DockerExecutableName)) assert.NilError(t, err) + env := []string{"PATH=" + bin} + if runtime.GOOS == "windows" { + env = append(env, "USERPROFILE="+home) + + } else { + env = append(env, "HOME="+home) + } + c := icmd.Cmd{ - Env: []string{"HOME=" + home, "PATH=" + bin}, + Env: env, Command: []string{filepath.Join(bin, "docker")}, } res := icmd.RunCmd(c)