Просмотр исходного кода

Fix `compose ls` tests

Signed-off-by: aiordache <[email protected]>
aiordache 5 лет назад
Родитель
Сommit
9098405313
2 измененных файлов с 12 добавлено и 1 удалено
  1. 11 0
      tests/aci-e2e/e2e-aci_test.go
  2. 1 1
      tests/ecs-e2e/e2e-ecs_test.go

+ 11 - 0
tests/aci-e2e/e2e-aci_test.go

@@ -466,6 +466,17 @@ func TestComposeUpUpdate(t *testing.T) {
 		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) {
 		res := c.RunDockerCmd("logs", serverContainer)
 		res.Assert(t, icmd.Expected{Out: "Listening on port 80"})

+ 1 - 1
tests/ecs-e2e/e2e-ecs_test.go

@@ -100,7 +100,7 @@ func TestCompose(t *testing.T) {
 
 	t.Run("compose ls", func(t *testing.T) {
 		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))
 		fields := strings.Fields(lines[1])