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

Function TestLocalComposeLargeLogs

pkg/e2e/logs_test.go:102–122  ·  pkg/e2e/logs_test.go::TestLocalComposeLargeLogs
(t *testing.T)

Source from the content-addressed store, hash-verified

100}
101
102func TestLocalComposeLargeLogs(t *testing.T) {
103 const projectName = "compose-e2e-large_logs"
104 file := filepath.Join(t.TempDir(), "large.txt")
105 c := NewCLI(t, WithEnv("FILE="+file))
106 t.Cleanup(func() {
107 c.RunDockerComposeCmd(t, "--project-name", projectName, "down")
108 })
109
110 f, err := os.Create(file)
111 assert.NilError(t, err)
112 for i := range 300_000 {
113 _, err := io.WriteString(f, fmt.Sprintf("This is line %d in a laaaarge text file\n", i))
114 assert.NilError(t, err)
115 }
116 assert.NilError(t, f.Close())
117
118 cmd := c.NewDockerComposeCmd(t, "-f", "./fixtures/logs-test/cat.yaml", "--project-name", projectName, "up", "--abort-on-container-exit", "--menu=false")
119 cmd.Stdout = io.Discard
120 res := icmd.RunCmd(cmd)
121 res.Assert(t, icmd.Expected{Out: "test-1 exited with code 0"})
122}
123
124func expectOutput(res *icmd.Result, expected string) func(t poll.LogT) poll.Result {
125 return func(t poll.LogT) poll.Result {

Callers

nothing calls this directly

Calls 8

RunDockerComposeCmdMethod · 0.95
NewDockerComposeCmdMethod · 0.95
NewCLIFunction · 0.85
WithEnvFunction · 0.85
TempDirMethod · 0.80
RunCmdMethod · 0.80
CreateMethod · 0.65
CloseMethod · 0.65

Tested by

no test coverage detected