mirror of https://github.com/docker/compose.git
Fix API Server E2E test using npipe on windows, not sockets
This commit is contained in:
parent
bed0b81343
commit
c92df92d29
|
@ -231,17 +231,26 @@ func (s *E2eSuite) TestAPIServer() {
|
|||
cName := "test-example"
|
||||
s.NewDockerCommand("context", "create", cName, "example").ExecOrDie()
|
||||
|
||||
sPath := fmt.Sprintf("unix:///%s/docker.sock", s.ConfigDir)
|
||||
//sPath := fmt.Sprintf("unix:///%s/docker.sock", s.ConfigDir)
|
||||
sPath, cliAddress := s.getGrpcServerAndCLientAddress()
|
||||
server, err := serveAPI(s.ConfigDir, sPath)
|
||||
Expect(err).To(BeNil())
|
||||
defer killProcess(server)
|
||||
|
||||
s.NewCommand("yarn", "install").WithinDirectory("../node-client").ExecOrDie()
|
||||
output := s.NewCommand("yarn", "run", "start", cName, sPath).WithinDirectory("../node-client").ExecOrDie()
|
||||
output := s.NewCommand("yarn", "run", "start", cName, cliAddress).WithinDirectory("../node-client").ExecOrDie()
|
||||
Expect(output).To(ContainSubstring("nginx"))
|
||||
})
|
||||
}
|
||||
|
||||
func (s *E2eSuite) getGrpcServerAndCLientAddress() (string, string) {
|
||||
if IsWindows() {
|
||||
return "npipe:////./pipe/clibackend", "unix:////./pipe/clibackend"
|
||||
}
|
||||
socketName := fmt.Sprintf("unix:///%s/docker.sock", s.ConfigDir)
|
||||
return socketName, socketName
|
||||
}
|
||||
|
||||
func TestE2e(t *testing.T) {
|
||||
suite.Run(t, new(E2eSuite))
|
||||
}
|
||||
|
|
|
@ -122,13 +122,13 @@ func (s *Suite) AfterTest(suite, test string) {
|
|||
|
||||
// ListProcessesCommand creates a command to list processes, "tasklist" on windows, "ps" otherwise.
|
||||
func (s *Suite) ListProcessesCommand() *CmdContext {
|
||||
if isWindows() {
|
||||
if IsWindows() {
|
||||
return s.NewCommand("tasklist")
|
||||
}
|
||||
return s.NewCommand("ps")
|
||||
}
|
||||
|
||||
func isWindows() bool {
|
||||
func IsWindows() bool {
|
||||
return runtime.GOOS == "windows"
|
||||
}
|
||||
|
||||
|
@ -142,14 +142,14 @@ func (s *Suite) NewCommand(command string, args ...string) *CmdContext {
|
|||
}
|
||||
|
||||
func dockerExecutable() string {
|
||||
if isWindows() {
|
||||
if IsWindows() {
|
||||
return "docker.exe"
|
||||
}
|
||||
return "docker"
|
||||
}
|
||||
|
||||
func DockerClassicExecutable() string {
|
||||
if isWindows() {
|
||||
if IsWindows() {
|
||||
return "docker-classic.exe"
|
||||
}
|
||||
return "docker-classic"
|
||||
|
|
Loading…
Reference in New Issue