|
|
@@ -63,3 +63,24 @@ func TestRestart(t *testing.T) {
|
|
|
c.RunDockerComposeCmd(t, "--project-name", projectName, "down")
|
|
|
})
|
|
|
}
|
|
|
+
|
|
|
+func TestRestartWithDependencies(t *testing.T) {
|
|
|
+ c := NewParallelCLI(t, WithEnv(
|
|
|
+ "COMPOSE_PROJECT_NAME=e2e-restart-deps",
|
|
|
+ ))
|
|
|
+ baseService := "nginx"
|
|
|
+ depWithRestart := "with-restart"
|
|
|
+ depNoRestart := "no-restart"
|
|
|
+
|
|
|
+ t.Cleanup(func() {
|
|
|
+ c.RunDockerComposeCmd(t, "down", "--remove-orphans")
|
|
|
+ })
|
|
|
+
|
|
|
+ c.RunDockerComposeCmd(t, "-f", "./fixtures/restart-test/compose-depends-on.yaml", "up", "-d")
|
|
|
+
|
|
|
+ res := c.RunDockerComposeCmd(t, "restart", baseService)
|
|
|
+ fmt.Println(res.Combined())
|
|
|
+ assert.Assert(t, strings.Contains(res.Combined(), fmt.Sprintf("Container e2e-restart-deps-%s-1 Started", baseService)), res.Combined())
|
|
|
+ assert.Assert(t, strings.Contains(res.Combined(), fmt.Sprintf("Container e2e-restart-deps-%s-1 Started", depWithRestart)), res.Combined())
|
|
|
+ assert.Assert(t, !strings.Contains(res.Combined(), depNoRestart), res.Combined())
|
|
|
+}
|