Update E2E test

Signed-off-by: Amit Saha <asaha@atlassian.com>
This commit is contained in:
Amit Saha 2023-01-25 12:54:49 +11:00 committed by Nicolas De loof
parent 90ca13b747
commit 8c964f5ad3
2 changed files with 9 additions and 3 deletions

View File

@ -6,3 +6,5 @@ services:
hello:
image: alpine
command: echo hello
deploy:
replicas: 2

View File

@ -56,9 +56,13 @@ func TestLocalComposeLogs(t *testing.T) {
t.Run("logs hello index", func(t *testing.T) {
res := c.RunDockerComposeCmd(t, "--project-name", projectName, "logs", "--index", "2", "hello")
// TODO: see if there is a way we can verify that the logs is from the second replica
// or if we need to..
res.Assert(t, icmd.Expected{Out: `hello`})
// docker-compose logs hello
// logs-test-hello-2 | hello
// logs-test-hello-1 | hello
t.Log(res.Stdout())
assert.Assert(t, !strings.Contains(res.Stdout(), "hello-1"))
assert.Assert(t, strings.Contains(res.Stdout(), "hello-2"))
})
t.Run("down", func(t *testing.T) {