mirror of
https://github.com/docker/compose.git
synced 2025-07-25 06:34:35 +02:00
Merge pull request #592 from docker/fix_compose_ls_tests
Fix `compose ls` tests
This commit is contained in:
commit
a2e0f16f07
@ -466,6 +466,17 @@ func TestComposeUpUpdate(t *testing.T) {
|
|||||||
assert.Check(t, webDisplayed && wordsDisplayed && dbDisplayed, "\n%s\n", res.Stdout())
|
assert.Check(t, webDisplayed && wordsDisplayed && dbDisplayed, "\n%s\n", res.Stdout())
|
||||||
})
|
})
|
||||||
|
|
||||||
|
t.Run("compose ls", func(t *testing.T) {
|
||||||
|
res := c.RunDockerCmd("compose", "ls", "--project-name", composeProjectName)
|
||||||
|
lines := strings.Split(strings.TrimSpace(res.Stdout()), "\n")
|
||||||
|
|
||||||
|
assert.Equal(t, 2, len(lines))
|
||||||
|
fields := strings.Fields(lines[1])
|
||||||
|
assert.Equal(t, 2, len(fields))
|
||||||
|
assert.Equal(t, fields[0], composeProjectName)
|
||||||
|
assert.Equal(t, "Running", fields[1])
|
||||||
|
})
|
||||||
|
|
||||||
t.Run("logs web", func(t *testing.T) {
|
t.Run("logs web", func(t *testing.T) {
|
||||||
res := c.RunDockerCmd("logs", serverContainer)
|
res := c.RunDockerCmd("logs", serverContainer)
|
||||||
res.Assert(t, icmd.Expected{Out: "Listening on port 80"})
|
res.Assert(t, icmd.Expected{Out: "Listening on port 80"})
|
||||||
|
@ -100,7 +100,7 @@ func TestCompose(t *testing.T) {
|
|||||||
|
|
||||||
t.Run("compose ls", func(t *testing.T) {
|
t.Run("compose ls", func(t *testing.T) {
|
||||||
res := c.RunDockerCmd("compose", "ls", "--project-name", stack)
|
res := c.RunDockerCmd("compose", "ls", "--project-name", stack)
|
||||||
lines := strings.Split(res.Stdout(), "\n")
|
lines := strings.Split(strings.TrimSpace(res.Stdout()), "\n")
|
||||||
|
|
||||||
assert.Equal(t, 2, len(lines))
|
assert.Equal(t, 2, len(lines))
|
||||||
fields := strings.Fields(lines[1])
|
fields := strings.Fields(lines[1])
|
||||||
|
Loading…
x
Reference in New Issue
Block a user