(t *testing.T)
| 121 | } |
| 122 | |
| 123 | func 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 | |
| 139 | func TestPreStartHookInError(t *testing.T) { |
| 140 | c := NewParallelCLI(t) |
nothing calls this directly
no test coverage detected