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

Function TestPostStartHookInError

pkg/e2e/hooks_test.go:38–49  ·  pkg/e2e/hooks_test.go::TestPostStartHookInError
(t *testing.T)

Source from the content-addressed store, hash-verified

36}
37
38func TestPostStartHookInError(t *testing.T) {
39 c := NewParallelCLI(t)
40 const projectName = "hooks-post-start-failure"
41
42 t.Cleanup(func() {
43 c.RunDockerComposeCmd(t, "--project-name", projectName, "down", "-v", "--remove-orphans", "-t", "0")
44 })
45
46 res := c.RunDockerComposeCmdNoCheck(t, "-f", "fixtures/hooks/poststart/compose-error.yaml", "--project-name", projectName, "up", "-d")
47 res.Assert(t, icmd.Expected{ExitCode: 1})
48 assert.Assert(t, strings.Contains(res.Combined(), "test hook exited with status 127"), res.Combined())
49}
50
51func TestPostStartHookSuccess(t *testing.T) {
52 c := NewParallelCLI(t)

Callers

nothing calls this directly

Calls 3

NewParallelCLIFunction · 0.85
RunDockerComposeCmdMethod · 0.80

Tested by

no test coverage detected