(t *testing.T)
| 68 | } |
| 69 | |
| 70 | func TestScaleWithDepsCases(t *testing.T) { |
| 71 | c := NewCLI(t, WithEnv( |
| 72 | "COMPOSE_PROJECT_NAME=scale-deps-tests")) |
| 73 | |
| 74 | reset := func() { |
| 75 | c.RunDockerComposeCmd(t, "down", "--rmi", "all") |
| 76 | } |
| 77 | t.Cleanup(reset) |
| 78 | res := c.RunDockerComposeCmd(t, "--project-directory", "fixtures/scale", "up", "-d", "--scale", "db=2") |
| 79 | res.Assert(t, icmd.Success) |
| 80 | |
| 81 | res = c.RunDockerComposeCmd(t, "ps") |
| 82 | checkServiceContainer(t, res.Combined(), "scale-deps-tests-db", NO_STATE_TO_CHECK, 2) |
| 83 | |
| 84 | t.Log("scale up 1 service with --no-deps") |
| 85 | _ = c.RunDockerComposeCmd(t, "--project-directory", "fixtures/scale", "scale", "--no-deps", "back=2") |
| 86 | res = c.RunDockerComposeCmd(t, "ps") |
| 87 | checkServiceContainer(t, res.Combined(), "scale-deps-tests-back", NO_STATE_TO_CHECK, 2) |
| 88 | checkServiceContainer(t, res.Combined(), "scale-deps-tests-db", NO_STATE_TO_CHECK, 2) |
| 89 | |
| 90 | t.Log("scale up 1 service without --no-deps") |
| 91 | _ = c.RunDockerComposeCmd(t, "--project-directory", "fixtures/scale", "scale", "back=2") |
| 92 | res = c.RunDockerComposeCmd(t, "ps") |
| 93 | checkServiceContainer(t, res.Combined(), "scale-deps-tests-back", NO_STATE_TO_CHECK, 2) |
| 94 | checkServiceContainer(t, res.Combined(), "scale-deps-tests-db", NO_STATE_TO_CHECK, 1) |
| 95 | } |
| 96 | |
| 97 | func TestScaleUpAndDownPreserveContainerNumber(t *testing.T) { |
| 98 | const projectName = "scale-up-down-test" |
nothing calls this directly
no test coverage detected