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

Function TestStartStopMultipleServices

pkg/e2e/start_stop_test.go:220–244  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

218}
219
220func TestStartStopMultipleServices(t *testing.T) {
221 cli := NewParallelCLI(t, WithEnv(
222 "COMPOSE_PROJECT_NAME=e2e-start-stop-svc-multiple",
223 "COMPOSE_FILE=./fixtures/start-stop/compose.yaml"))
224 t.Cleanup(func() {
225 cli.RunDockerComposeCmd(t, "down", "--remove-orphans", "-v", "-t", "0")
226 })
227
228 cli.RunDockerComposeCmd(t, "up", "-d", "--wait")
229
230 res := cli.RunDockerComposeCmd(t, "stop", "simple", "another")
231 services := []string{"simple", "another"}
232 for _, svc := range services {
233 stopMsg := fmt.Sprintf("Container e2e-start-stop-svc-multiple-%s-1 Stopped", svc)
234 assert.Assert(t, strings.Contains(res.Stderr(), stopMsg),
235 fmt.Sprintf("Missing stop message for %s\n%s", svc, res.Combined()))
236 }
237
238 res = cli.RunDockerComposeCmd(t, "start", "simple", "another")
239 for _, svc := range services {
240 startMsg := fmt.Sprintf("Container e2e-start-stop-svc-multiple-%s-1 Started", svc)
241 assert.Assert(t, strings.Contains(res.Stderr(), startMsg),
242 fmt.Sprintf("Missing start message for %s\n%s", svc, res.Combined()))
243 }
244}
245
246func TestStartSingleServiceAndDependency(t *testing.T) {
247 cli := NewParallelCLI(t, WithEnv(

Callers

nothing calls this directly

Calls 3

NewParallelCLIFunction · 0.85
WithEnvFunction · 0.85
RunDockerComposeCmdMethod · 0.80

Tested by

no test coverage detected