1
0
Эх сурвалжийг харах

Merge pull request #1258 from docker/red-e2e_compose_flags

Adapt e2e tests to compose flag order
Guillaume Tardif 4 жил өмнө
parent
commit
9f56fc9fd6

+ 7 - 7
aci/e2e/e2e-aci_test.go

@@ -557,7 +557,7 @@ func TestUpSecretsResources(t *testing.T) {
 	_, _, _ = setupTestResourceGroup(t, c)
 
 	t.Run("compose up", func(t *testing.T) {
-		c.RunDockerCmd("compose", "up", "-f", composefilePath, "--project-name", composeProjectName)
+		c.RunDockerCmd("compose", "-f", composefilePath, "--project-name", composeProjectName, "up")
 		res := c.RunDockerCmd("ps")
 		out := Lines(res.Stdout())
 		// Check 2 containers running
@@ -565,7 +565,7 @@ func TestUpSecretsResources(t *testing.T) {
 	})
 
 	t.Cleanup(func() {
-		c.RunDockerCmd("compose", "down", "--project-name", composeProjectName)
+		c.RunDockerCmd("compose", "--project-name", composeProjectName, "down")
 		res := c.RunDockerCmd("ps")
 		out := Lines(res.Stdout())
 		assert.Equal(t, len(out), 1)
@@ -696,7 +696,7 @@ func TestUpUpdate(t *testing.T) {
 			Location:       location,
 			ResourceGroup:  groupID,
 		}
-		c.RunDockerCmd("compose", "up", "-f", singlePortVolumesComposefile, "--domainname", dnsLabelName, "--project-name", projectName)
+		c.RunDockerCmd("compose", "-f", singlePortVolumesComposefile, "--project-name", projectName, "up", "--domainname", dnsLabelName)
 
 		// Volume should be autocreated by the "compose up"
 		uploadTestFile(t, aciContext, composeAccountName, fileshareName, testFileName, testFileContent)
@@ -747,11 +747,11 @@ func TestUpUpdate(t *testing.T) {
 	})
 
 	t.Run("compose ps", func(t *testing.T) {
-		res := c.RunDockerCmd("compose", "ps", "--project-name", composeProjectName, "--quiet")
+		res := c.RunDockerCmd("compose", "--project-name", composeProjectName, "ps", "--quiet")
 		l := Lines(res.Stdout())
 		assert.Assert(t, is.Len(l, 3))
 
-		res = c.RunDockerCmd("compose", "ps", "--project-name", composeProjectName)
+		res = c.RunDockerCmd("compose", "--project-name", composeProjectName, "ps")
 		l = Lines(res.Stdout())
 		assert.Assert(t, is.Len(l, 4))
 		var wordsDisplayed, webDisplayed, dbDisplayed bool
@@ -797,7 +797,7 @@ func TestUpUpdate(t *testing.T) {
 	})
 
 	t.Run("update", func(t *testing.T) {
-		c.RunDockerCmd("compose", "up", "-f", multiPortComposefile, "--project-name", composeProjectName)
+		c.RunDockerCmd("compose", "-f", multiPortComposefile, "--project-name", composeProjectName, "up")
 		res := c.RunDockerCmd("ps")
 		out := Lines(res.Stdout())
 		// Check three containers are running
@@ -832,7 +832,7 @@ func TestUpUpdate(t *testing.T) {
 	})
 
 	t.Run("down", func(t *testing.T) {
-		c.RunDockerCmd("compose", "down", "--project-name", composeProjectName)
+		c.RunDockerCmd("compose", "--project-name", composeProjectName, "down")
 		res := c.RunDockerCmd("ps")
 		out := Lines(res.Stdout())
 		assert.Equal(t, len(out), 1)

+ 1 - 1
cli/metrics/metrics_test.go

@@ -130,7 +130,7 @@ func TestGetCommand(t *testing.T) {
 		},
 		{
 			name:     "compose up -f xxx",
-			args:     []string{"compose", "up", "-f", "titi.yaml"},
+			args:     []string{"compose", "-f", "up", "titi.yaml"},
 			expected: "compose up",
 		},
 		{

+ 3 - 3
ecs/e2e/ecs/e2e-ecs_test.go

@@ -81,12 +81,12 @@ func TestCompose(t *testing.T) {
 	c, stack := setupTest(t)
 
 	t.Run("compose up", func(t *testing.T) {
-		c.RunDockerCmd("compose", "up", "--project-name", stack, "-f", "./multi_port_secrets.yaml")
+		c.RunDockerCmd("compose", "--project-name", stack, "-f", "./multi_port_secrets.yaml", "up")
 	})
 
 	var webURL, wordsURL, secretsURL string
 	t.Run("compose ps", func(t *testing.T) {
-		res := c.RunDockerCmd("compose", "ps", "--project-name", stack)
+		res := c.RunDockerCmd("compose", "--project-name", stack, "ps")
 		lines := strings.Split(strings.TrimSpace(res.Stdout()), "\n")
 
 		assert.Equal(t, 5, len(lines))
@@ -152,7 +152,7 @@ func TestCompose(t *testing.T) {
 	})
 
 	t.Run("compose down", func(t *testing.T) {
-		cmd := c.NewDockerCmd("compose", "down", "--project-name", stack)
+		cmd := c.NewDockerCmd("compose", "--project-name", stack, "down")
 		res := icmd.StartCmd(cmd)
 
 		checkUp := func(t poll.LogT) poll.Result {

+ 2 - 2
kube/e2e/compose_test.go

@@ -85,7 +85,7 @@ func TestComposeUp(t *testing.T) {
 			// db-698f4dd798-jd9gw      db                  Running
 			return fmt.Sprintf("%s-.*\\s+%s\\s+Pending\\s+", service, service)
 		}
-		res := c.RunDockerCmd("compose", "ps", "-p", projectName, "--all")
+		res := c.RunDockerCmd("compose", "-p", projectName, "ps", "--all")
 		testify.Regexp(t, getServiceRegx("db"), res.Stdout())
 		testify.Regexp(t, getServiceRegx("words"), res.Stdout())
 		testify.Regexp(t, getServiceRegx("web"), res.Stdout())
@@ -94,7 +94,7 @@ func TestComposeUp(t *testing.T) {
 	})
 
 	t.Run("compose ps hides non running containers", func(t *testing.T) {
-		res := c.RunDockerCmd("compose", "ps", "-p", projectName)
+		res := c.RunDockerCmd("compose", "-p", projectName, "ps")
 		assert.Equal(t, len(Lines(res.Stdout())), 1, res.Stdout())
 	})