mirror of
https://github.com/docker/compose.git
synced 2025-07-21 12:44:54 +02:00
Add E2E tests for compose stop
with compose file
Signed-off-by: Laura Brehm <laurabrehm@hey.com>
This commit is contained in:
parent
f6e96dd783
commit
d2a6c2c200
5
pkg/e2e/fixtures/start-stop/other.yaml
Normal file
5
pkg/e2e/fixtures/start-stop/other.yaml
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
services:
|
||||||
|
a-different-one:
|
||||||
|
image: nginx:alpine
|
||||||
|
and-another-one:
|
||||||
|
image: nginx:alpine
|
@ -246,3 +246,19 @@ func TestStartStopMultipleServices(t *testing.T) {
|
|||||||
fmt.Sprintf("Missing start message for %s\n%s", svc, res.Combined()))
|
fmt.Sprintf("Missing start message for %s\n%s", svc, res.Combined()))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestStartStopMultipleFiles(t *testing.T) {
|
||||||
|
cli := NewParallelCLI(t, WithEnv("COMPOSE_PROJECT_NAME=e2e-start-stop-svc-multiple-files"))
|
||||||
|
t.Cleanup(func() {
|
||||||
|
cli.RunDockerComposeCmd(t, "-p", "e2e-start-stop-svc-multiple-files", "down", "--remove-orphans")
|
||||||
|
})
|
||||||
|
|
||||||
|
cli.RunDockerComposeCmd(t, "-f", "./fixtures/start-stop/compose.yaml", "up", "-d")
|
||||||
|
cli.RunDockerComposeCmd(t, "-f", "./fixtures/start-stop/other.yaml", "up", "-d")
|
||||||
|
|
||||||
|
res := cli.RunDockerComposeCmd(t, "-f", "./fixtures/start-stop/compose.yaml", "stop")
|
||||||
|
assert.Assert(t, strings.Contains(res.Combined(), "Container e2e-start-stop-svc-multiple-files-simple-1 Stopped"), res.Combined())
|
||||||
|
assert.Assert(t, strings.Contains(res.Combined(), "Container e2e-start-stop-svc-multiple-files-another-1 Stopped"), res.Combined())
|
||||||
|
assert.Assert(t, !strings.Contains(res.Combined(), "Container e2e-start-stop-svc-multiple-files-a-different-one-1 Stopped"), res.Combined())
|
||||||
|
assert.Assert(t, !strings.Contains(res.Combined(), "Container e2e-start-stop-svc-multiple-files-and-another-one-1 Stopped"), res.Combined())
|
||||||
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user