down: fix COMPOSE_REMOVE_ORPHANS env name and add test

Fixes #9562.

Signed-off-by: Nick Sieger <nick@nicksieger.com>
This commit is contained in:
Nick Sieger 2022-06-16 08:34:21 -05:00
parent de0f23315b
commit 49fb4ca25f
No known key found for this signature in database
GPG Key ID: 222EA328BD6E402A
2 changed files with 5 additions and 3 deletions

View File

@ -116,8 +116,10 @@ func TestLocalComposeRun(t *testing.T) {
})
t.Run("down", func(t *testing.T) {
c.RunDockerComposeCmd(t, "-f", "./fixtures/run-test/compose.yaml", "down")
c.RunDockerComposeCmd(t, "-f", "./fixtures/run-test/orphan.yaml", "down")
cmd := c.NewDockerCmd("compose", "-f", "./fixtures/run-test/compose.yaml", "down")
icmd.RunCmd(cmd, func(c *icmd.Cmd) {
c.Env = append(c.Env, "COMPOSE_REMOVE_ORPHANS=True")
})
res := c.RunDockerCmd(t, "ps", "--all")
assert.Assert(t, !strings.Contains(res.Stdout(), "run-test"), res.Stdout())
})