Skip to content

Commit

Permalink
Merge pull request moby#45812 from thaJeztah/no_homedir
Browse files Browse the repository at this point in the history
integration-cli: don't use pkg/homedir in test
  • Loading branch information
thaJeztah committed Jun 26, 2023
2 parents 56261fa + 0215a62 commit db381fb
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions integration-cli/docker_cli_run_unix_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (
"os/exec"
"path/filepath"
"regexp"
"runtime"
"strconv"
"strings"
"syscall"
Expand All @@ -21,7 +22,6 @@ import (
"github.com/docker/docker/client"
"github.com/docker/docker/integration-cli/cli"
"github.com/docker/docker/integration-cli/cli/build"
"github.com/docker/docker/pkg/homedir"
"github.com/docker/docker/pkg/parsers"
"github.com/docker/docker/pkg/sysinfo"
"github.com/moby/sys/mount"
Expand Down Expand Up @@ -250,7 +250,11 @@ func (s *DockerCLIRunSuite) TestRunAttachDetachFromConfig(c *testing.T) {
os.Mkdir(dotDocker, 0600)
tmpCfg := filepath.Join(dotDocker, "config.json")

c.Setenv(homedir.Key(), tmpDir)
if runtime.GOOS == "windows" {
c.Setenv("USERPROFILE", tmpDir)
} else {
c.Setenv("HOME", tmpDir)
}

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

c.Setenv(homedir.Key(), tmpDir)
if runtime.GOOS == "windows" {
c.Setenv("USERPROFILE", tmpDir)
} else {
c.Setenv("HOME", tmpDir)
}

data := `{
"detachKeys": "ctrl-e,e"
Expand Down

0 comments on commit db381fb

Please sign in to comment.