Skip to content

Commit c01c9c2

Browse files
ndeloofglours
authored andcommitted
e2e test to prevent future regression
Signed-off-by: Nicolas De Loof <[email protected]>
1 parent 038c81f commit c01c9c2

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
services:
2+
app:
3+
image: alpine
4+
volumes:
5+
- .:/my_vol

pkg/e2e/volumes_test.go

+13
Original file line numberDiff line numberDiff line change
@@ -161,3 +161,16 @@ func TestUpRecreateVolumes(t *testing.T) {
161161
res = c.RunDockerCmd(t, "volume", "inspect", fmt.Sprintf("%s_my_vol", projectName), "-f", "{{ index .Labels \"foo\" }}")
162162
res.Assert(t, icmd.Expected{Out: "zot"})
163163
}
164+
165+
func TestUpRecreateVolumes_IgnoreBinds(t *testing.T) {
166+
c := NewCLI(t)
167+
const projectName = "compose-e2e-recreate-volumes"
168+
t.Cleanup(func() {
169+
c.cleanupWithDown(t, projectName)
170+
})
171+
172+
c.RunDockerComposeCmd(t, "-f", "./fixtures/recreate-volumes/bind.yaml", "--project-name", projectName, "up", "-d")
173+
174+
res := c.RunDockerComposeCmd(t, "-f", "./fixtures/recreate-volumes/bind.yaml", "--project-name", projectName, "up", "-d")
175+
assert.Check(t, !strings.Contains(res.Combined(), "Recreated"))
176+
}

0 commit comments

Comments
 (0)