mirror of
https://github.com/docker/compose.git
synced 2025-07-20 12:14:41 +02:00
Merge pull request #1258 from docker/red-e2e_compose_flags
Adapt e2e tests to compose flag order
This commit is contained in:
commit
9f56fc9fd6
@ -557,7 +557,7 @@ func TestUpSecretsResources(t *testing.T) {
|
|||||||
_, _, _ = setupTestResourceGroup(t, c)
|
_, _, _ = setupTestResourceGroup(t, c)
|
||||||
|
|
||||||
t.Run("compose up", func(t *testing.T) {
|
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")
|
res := c.RunDockerCmd("ps")
|
||||||
out := Lines(res.Stdout())
|
out := Lines(res.Stdout())
|
||||||
// Check 2 containers running
|
// Check 2 containers running
|
||||||
@ -565,7 +565,7 @@ func TestUpSecretsResources(t *testing.T) {
|
|||||||
})
|
})
|
||||||
|
|
||||||
t.Cleanup(func() {
|
t.Cleanup(func() {
|
||||||
c.RunDockerCmd("compose", "down", "--project-name", composeProjectName)
|
c.RunDockerCmd("compose", "--project-name", composeProjectName, "down")
|
||||||
res := c.RunDockerCmd("ps")
|
res := c.RunDockerCmd("ps")
|
||||||
out := Lines(res.Stdout())
|
out := Lines(res.Stdout())
|
||||||
assert.Equal(t, len(out), 1)
|
assert.Equal(t, len(out), 1)
|
||||||
@ -696,7 +696,7 @@ func TestUpUpdate(t *testing.T) {
|
|||||||
Location: location,
|
Location: location,
|
||||||
ResourceGroup: groupID,
|
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"
|
// Volume should be autocreated by the "compose up"
|
||||||
uploadTestFile(t, aciContext, composeAccountName, fileshareName, testFileName, testFileContent)
|
uploadTestFile(t, aciContext, composeAccountName, fileshareName, testFileName, testFileContent)
|
||||||
@ -747,11 +747,11 @@ func TestUpUpdate(t *testing.T) {
|
|||||||
})
|
})
|
||||||
|
|
||||||
t.Run("compose ps", func(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())
|
l := Lines(res.Stdout())
|
||||||
assert.Assert(t, is.Len(l, 3))
|
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())
|
l = Lines(res.Stdout())
|
||||||
assert.Assert(t, is.Len(l, 4))
|
assert.Assert(t, is.Len(l, 4))
|
||||||
var wordsDisplayed, webDisplayed, dbDisplayed bool
|
var wordsDisplayed, webDisplayed, dbDisplayed bool
|
||||||
@ -797,7 +797,7 @@ func TestUpUpdate(t *testing.T) {
|
|||||||
})
|
})
|
||||||
|
|
||||||
t.Run("update", func(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")
|
res := c.RunDockerCmd("ps")
|
||||||
out := Lines(res.Stdout())
|
out := Lines(res.Stdout())
|
||||||
// Check three containers are running
|
// Check three containers are running
|
||||||
@ -832,7 +832,7 @@ func TestUpUpdate(t *testing.T) {
|
|||||||
})
|
})
|
||||||
|
|
||||||
t.Run("down", func(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")
|
res := c.RunDockerCmd("ps")
|
||||||
out := Lines(res.Stdout())
|
out := Lines(res.Stdout())
|
||||||
assert.Equal(t, len(out), 1)
|
assert.Equal(t, len(out), 1)
|
||||||
|
@ -130,7 +130,7 @@ func TestGetCommand(t *testing.T) {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "compose up -f xxx",
|
name: "compose up -f xxx",
|
||||||
args: []string{"compose", "up", "-f", "titi.yaml"},
|
args: []string{"compose", "-f", "up", "titi.yaml"},
|
||||||
expected: "compose up",
|
expected: "compose up",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -81,12 +81,12 @@ func TestCompose(t *testing.T) {
|
|||||||
c, stack := setupTest(t)
|
c, stack := setupTest(t)
|
||||||
|
|
||||||
t.Run("compose up", func(t *testing.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
|
var webURL, wordsURL, secretsURL string
|
||||||
t.Run("compose ps", func(t *testing.T) {
|
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")
|
lines := strings.Split(strings.TrimSpace(res.Stdout()), "\n")
|
||||||
|
|
||||||
assert.Equal(t, 5, len(lines))
|
assert.Equal(t, 5, len(lines))
|
||||||
@ -152,7 +152,7 @@ func TestCompose(t *testing.T) {
|
|||||||
})
|
})
|
||||||
|
|
||||||
t.Run("compose down", func(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)
|
res := icmd.StartCmd(cmd)
|
||||||
|
|
||||||
checkUp := func(t poll.LogT) poll.Result {
|
checkUp := func(t poll.LogT) poll.Result {
|
||||||
|
@ -85,7 +85,7 @@ func TestComposeUp(t *testing.T) {
|
|||||||
// db-698f4dd798-jd9gw db Running
|
// db-698f4dd798-jd9gw db Running
|
||||||
return fmt.Sprintf("%s-.*\\s+%s\\s+Pending\\s+", service, service)
|
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("db"), res.Stdout())
|
||||||
testify.Regexp(t, getServiceRegx("words"), res.Stdout())
|
testify.Regexp(t, getServiceRegx("words"), res.Stdout())
|
||||||
testify.Regexp(t, getServiceRegx("web"), 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) {
|
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())
|
assert.Equal(t, len(Lines(res.Stdout())), 1, res.Stdout())
|
||||||
})
|
})
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user