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

Function TestStartSingleServiceAndDependency

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

Source from the content-addressed store, hash-verified

244}
245
246func TestStartSingleServiceAndDependency(t *testing.T) {
247 cli := NewParallelCLI(t, WithEnv(
248 "COMPOSE_PROJECT_NAME=e2e-start-single-deps",
249 "COMPOSE_FILE=./fixtures/start-stop/start-stop-deps.yaml"))
250 t.Cleanup(func() {
251 cli.RunDockerComposeCmd(t, "down", "--remove-orphans", "-v", "-t", "0")
252 })
253
254 cli.RunDockerComposeCmd(t, "create", "desired")
255
256 res := cli.RunDockerComposeCmd(t, "start", "desired")
257 desiredServices := []string{"desired", "dep_1", "dep_2"}
258 for _, s := range desiredServices {
259 startMsg := fmt.Sprintf("Container e2e-start-single-deps-%s-1 Started", s)
260 assert.Assert(t, strings.Contains(res.Combined(), startMsg),
261 fmt.Sprintf("Missing start message for service: %s\n%s", s, res.Combined()))
262 }
263 undesiredServices := []string{"another", "another_2"}
264 for _, s := range undesiredServices {
265 assert.Assert(t, !strings.Contains(res.Combined(), s),
266 fmt.Sprintf("Shouldn't have message for service: %s\n%s", s, res.Combined()))
267 }
268}
269
270func TestStartStopMultipleFiles(t *testing.T) {
271 cli := NewParallelCLI(t, WithEnv("COMPOSE_PROJECT_NAME=e2e-start-stop-svc-multiple-files"))

Callers

nothing calls this directly

Calls 3

NewParallelCLIFunction · 0.85
WithEnvFunction · 0.85
RunDockerComposeCmdMethod · 0.80

Tested by

no test coverage detected