Просмотр исходного кода

e2e test to prevent future regression

Signed-off-by: Nicolas De Loof <[email protected]>
Nicolas De Loof 1 год назад
Родитель
Сommit
c01c9c29f4
2 измененных файлов с 18 добавлено и 0 удалено
  1. 5 0
      pkg/e2e/fixtures/recreate-volumes/bind.yaml
  2. 13 0
      pkg/e2e/volumes_test.go

+ 5 - 0
pkg/e2e/fixtures/recreate-volumes/bind.yaml

@@ -0,0 +1,5 @@
+services:
+  app:
+    image: alpine
+    volumes:
+      - .:/my_vol

+ 13 - 0
pkg/e2e/volumes_test.go

@@ -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"))
+}