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

Function TestCascadeFail

pkg/e2e/cascade_test.go:42–55  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

40}
41
42func TestCascadeFail(t *testing.T) {
43 c := NewCLI(t)
44 const projectName = "compose-e2e-cascade-fail"
45 t.Cleanup(func() {
46 c.RunDockerComposeCmd(t, "--project-name", projectName, "down")
47 })
48
49 res := c.RunDockerComposeCmdNoCheck(t, "-f", "./fixtures/cascade/compose.yaml", "--project-name", projectName,
50 "up", "--abort-on-container-failure")
51 assert.Assert(t, strings.Contains(res.Combined(), "exit-1 exited with code 0"), res.Combined())
52 assert.Assert(t, strings.Contains(res.Combined(), "fail-1 exited with code 111"), res.Combined())
53 // failing exit code should be propagated
54 assert.Equal(t, res.ExitCode, 111)
55}

Callers

nothing calls this directly

Calls 3

RunDockerComposeCmdMethod · 0.95
NewCLIFunction · 0.85

Tested by

no test coverage detected