Skip to content

Commit 0215a62

Browse files
committed
integration-cli: don't use pkg/homedir in test
I'm considering deprecating the "Key()" utility, as it was only used in tests. Signed-off-by: Sebastiaan van Stijn <[email protected]>
1 parent 56261fa commit 0215a62

1 file changed

Lines changed: 11 additions & 3 deletions

File tree

integration-cli/docker_cli_run_unix_test.go

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import (
1111
"os/exec"
1212
"path/filepath"
1313
"regexp"
14+
"runtime"
1415
"strconv"
1516
"strings"
1617
"syscall"
@@ -21,7 +22,6 @@ import (
2122
"github.com/docker/docker/client"
2223
"github.com/docker/docker/integration-cli/cli"
2324
"github.com/docker/docker/integration-cli/cli/build"
24-
"github.com/docker/docker/pkg/homedir"
2525
"github.com/docker/docker/pkg/parsers"
2626
"github.com/docker/docker/pkg/sysinfo"
2727
"github.com/moby/sys/mount"
@@ -250,7 +250,11 @@ func (s *DockerCLIRunSuite) TestRunAttachDetachFromConfig(c *testing.T) {
250250
os.Mkdir(dotDocker, 0600)
251251
tmpCfg := filepath.Join(dotDocker, "config.json")
252252

253-
c.Setenv(homedir.Key(), tmpDir)
253+
if runtime.GOOS == "windows" {
254+
c.Setenv("USERPROFILE", tmpDir)
255+
} else {
256+
c.Setenv("HOME", tmpDir)
257+
}
254258

255259
data := `{
256260
"detachKeys": "ctrl-a,a"
@@ -330,7 +334,11 @@ func (s *DockerCLIRunSuite) TestRunAttachDetachKeysOverrideConfig(c *testing.T)
330334
os.Mkdir(dotDocker, 0600)
331335
tmpCfg := filepath.Join(dotDocker, "config.json")
332336

333-
c.Setenv(homedir.Key(), tmpDir)
337+
if runtime.GOOS == "windows" {
338+
c.Setenv("USERPROFILE", tmpDir)
339+
} else {
340+
c.Setenv("HOME", tmpDir)
341+
}
334342

335343
data := `{
336344
"detachKeys": "ctrl-e,e"

0 commit comments

Comments
 (0)