Merge pull request #446 from docker/e2e-fix-windwows

Fix e2e tests on Windows
This commit is contained in:
Guillaume Tardif 2020-08-10 14:50:22 +02:00 committed by GitHub
commit 6405256752
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 1 deletions

View File

@ -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)