(t *testing.T)
| 76 | } |
| 77 | |
| 78 | func TestPreStopHookInError(t *testing.T) { |
| 79 | c := NewParallelCLI(t) |
| 80 | const projectName = "hooks-pre-stop-failure" |
| 81 | |
| 82 | t.Cleanup(func() { |
| 83 | c.RunDockerComposeCmd(t, "-f", "fixtures/hooks/prestop/compose-success.yaml", "--project-name", projectName, "down", "-v", "--remove-orphans", "-t", "0") |
| 84 | }) |
| 85 | |
| 86 | res := c.RunDockerComposeCmdNoCheck(t, "-f", "fixtures/hooks/prestop/compose-error.yaml", "--project-name", projectName, "up", "-d") |
| 87 | res.Assert(t, icmd.Expected{ExitCode: 0}) |
| 88 | |
| 89 | res = c.RunDockerComposeCmdNoCheck(t, "-f", "fixtures/hooks/prestop/compose-error.yaml", "--project-name", projectName, "down", "-v", "--remove-orphans", "-t", "0") |
| 90 | res.Assert(t, icmd.Expected{ExitCode: 1}) |
| 91 | assert.Assert(t, strings.Contains(res.Combined(), "sample hook exited with status 127")) |
| 92 | } |
| 93 | |
| 94 | func TestPreStopHookSuccessWithPreviousStop(t *testing.T) { |
| 95 | c := NewParallelCLI(t) |
nothing calls this directly
no test coverage detected