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

Function TestPreStartHookSuccess

pkg/e2e/hooks_test.go:123–137  ·  pkg/e2e/hooks_test.go::TestPreStartHookSuccess
(t *testing.T)

Source from the content-addressed store, hash-verified

121}
122
123func TestPreStartHookSuccess(t *testing.T) {
124 c := NewParallelCLI(t)
125 const projectName = "hooks-pre-start-success"
126
127 t.Cleanup(func() {
128 c.RunDockerComposeCmd(t, "-f", "fixtures/pre_start/compose-success.yaml", "--project-name", projectName, "down", "-v", "--remove-orphans", "-t", "0")
129 })
130
131 res := c.RunDockerComposeCmd(t, "-f", "fixtures/pre_start/compose-success.yaml", "--project-name", projectName, "up", "-d", "--wait")
132 res.Assert(t, icmd.Expected{ExitCode: 0})
133
134 // Service should be able to read the file written by the pre_start hook.
135 logs := c.RunDockerComposeCmd(t, "-f", "fixtures/pre_start/compose-success.yaml", "--project-name", projectName, "logs", "sample")
136 assert.Assert(t, strings.Contains(logs.Combined(), "initialized"), logs.Combined())
137}
138
139func TestPreStartHookInError(t *testing.T) {
140 c := NewParallelCLI(t)

Callers

nothing calls this directly

Calls 2

NewParallelCLIFunction · 0.85
RunDockerComposeCmdMethod · 0.80

Tested by

no test coverage detected