Skip to content

Commit

Permalink
e2e test to prevent future regression
Browse files Browse the repository at this point in the history
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
  • Loading branch information
ndeloof authored and glours committed Dec 16, 2024
1 parent 038c81f commit c01c9c2
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pkg/e2e/fixtures/recreate-volumes/bind.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
services:
app:
image: alpine
volumes:
- .:/my_vol
13 changes: 13 additions & 0 deletions pkg/e2e/volumes_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -161,3 +161,16 @@ func TestUpRecreateVolumes(t *testing.T) {
res = c.RunDockerCmd(t, "volume", "inspect", fmt.Sprintf("%s_my_vol", projectName), "-f", "{{ index .Labels \"foo\" }}")
res.Assert(t, icmd.Expected{Out: "zot"})
}

func TestUpRecreateVolumes_IgnoreBinds(t *testing.T) {
c := NewCLI(t)
const projectName = "compose-e2e-recreate-volumes"
t.Cleanup(func() {
c.cleanupWithDown(t, projectName)
})

c.RunDockerComposeCmd(t, "-f", "./fixtures/recreate-volumes/bind.yaml", "--project-name", projectName, "up", "-d")

res := c.RunDockerComposeCmd(t, "-f", "./fixtures/recreate-volumes/bind.yaml", "--project-name", projectName, "up", "-d")
assert.Check(t, !strings.Contains(res.Combined(), "Recreated"))
}

0 comments on commit c01c9c2

Please # to comment.