MCPcopy
hub / github.com/docker/compose / TestLoggingDriver

Function TestLoggingDriver

pkg/e2e/compose_up_test.go:95–114  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

93}
94
95func TestLoggingDriver(t *testing.T) {
96 c := NewCLI(t)
97 const projectName = "e2e-logging-driver"
98 defer c.cleanupWithDown(t, projectName)
99
100 host := "HOST=127.0.0.1"
101 res := c.RunDockerCmd(t, "info", "-f", "{{.OperatingSystem}}")
102 os := res.Stdout()
103 if strings.TrimSpace(os) == "Docker Desktop" {
104 host = "HOST=host.docker.internal"
105 }
106
107 cmd := c.NewDockerComposeCmd(t, "-f", "fixtures/logging-driver/compose.yaml", "--project-name", projectName, "up", "-d")
108 cmd.Env = append(cmd.Env, host, "BAR=foo")
109 icmd.RunCmd(cmd).Assert(t, icmd.Success)
110
111 cmd = c.NewDockerComposeCmd(t, "-f", "fixtures/logging-driver/compose.yaml", "--project-name", projectName, "up", "-d")
112 cmd.Env = append(cmd.Env, host, "BAR=zot")
113 icmd.RunCmd(cmd).Assert(t, icmd.Success)
114}

Callers

nothing calls this directly

Calls 5

cleanupWithDownMethod · 0.95
RunDockerCmdMethod · 0.95
NewDockerComposeCmdMethod · 0.95
NewCLIFunction · 0.85
RunCmdMethod · 0.80

Tested by

no test coverage detected