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

Function TestLocalComposeLogsFollow

pkg/e2e/logs_test.go:76–100  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

74}
75
76func TestLocalComposeLogsFollow(t *testing.T) {
77 c := NewCLI(t, WithEnv("REPEAT=20"))
78 const projectName = "compose-e2e-logs"
79 t.Cleanup(func() {
80 c.RunDockerComposeCmd(t, "--project-name", projectName, "down")
81 })
82
83 c.RunDockerComposeCmd(t, "-f", "./fixtures/logs-test/compose.yaml", "--project-name", projectName, "up", "-d", "ping")
84
85 cmd := c.NewDockerComposeCmd(t, "--project-name", projectName, "logs", "-f")
86 res := icmd.StartCmd(cmd)
87 t.Cleanup(func() {
88 _ = res.Cmd.Process.Kill()
89 })
90
91 poll.WaitOn(t, expectOutput(res, "ping-1 "), poll.WithDelay(100*time.Millisecond), poll.WithTimeout(1*time.Second))
92
93 c.RunDockerComposeCmd(t, "-f", "./fixtures/logs-test/compose.yaml", "--project-name", projectName, "up", "-d")
94
95 poll.WaitOn(t, expectOutput(res, "hello-1 "), poll.WithDelay(100*time.Millisecond), poll.WithTimeout(1*time.Second))
96
97 c.RunDockerComposeCmd(t, "-f", "./fixtures/logs-test/compose.yaml", "--project-name", projectName, "up", "-d", "--scale", "ping=2", "ping")
98
99 poll.WaitOn(t, expectOutput(res, "ping-2 "), poll.WithDelay(100*time.Millisecond), poll.WithTimeout(20*time.Second))
100}
101
102func TestLocalComposeLargeLogs(t *testing.T) {
103 const projectName = "compose-e2e-large_logs"

Callers

nothing calls this directly

Calls 6

RunDockerComposeCmdMethod · 0.95
NewDockerComposeCmdMethod · 0.95
NewCLIFunction · 0.85
WithEnvFunction · 0.85
expectOutputFunction · 0.85
KillMethod · 0.65

Tested by

no test coverage detected