فهرست منبع

Fix compose volume creation and check this in volume e2e test

Signed-off-by: Guillaume Tardif <[email protected]>
Guillaume Tardif 5 سال پیش
والد
کامیت
d0728d94f2
1فایلهای تغییر یافته به همراه3 افزوده شده و 1 حذف شده
  1. 3 1
      local/e2e/compose_test.go

+ 3 - 1
local/e2e/compose_test.go

@@ -95,12 +95,14 @@ func TestLocalComposeVolume(t *testing.T) {
 
 
 	t.Run("up with build and no image name, volume", func(t *testing.T) {
 	t.Run("up with build and no image name, volume", func(t *testing.T) {
 		//ensure local test run does not reuse previously build image
 		//ensure local test run does not reuse previously build image
-		c.RunDockerOrExitError("--context", "default", "rmi", "compose-e2e-volume_nginx")
+		c.RunDockerOrExitError("rmi", "compose-e2e-volume_nginx")
+		c.RunDockerOrExitError("volume", "rm", projectName+"_staticVol")
 		c.RunDockerCmd("compose", "up", "-d", "--workdir", "volume-test", "--project-name", projectName)
 		c.RunDockerCmd("compose", "up", "-d", "--workdir", "volume-test", "--project-name", projectName)
 
 
 		output := HTTPGetWithRetry(t, "http://localhost:8090", http.StatusOK, 2*time.Second, 20*time.Second)
 		output := HTTPGetWithRetry(t, "http://localhost:8090", http.StatusOK, 2*time.Second, 20*time.Second)
 		assert.Assert(t, strings.Contains(output, "Hello from Nginx container"))
 		assert.Assert(t, strings.Contains(output, "Hello from Nginx container"))
 
 
 		_ = c.RunDockerCmd("compose", "down", "--project-name", projectName)
 		_ = c.RunDockerCmd("compose", "down", "--project-name", projectName)
+		_ = c.RunDockerCmd("volume", "rm", projectName+"_staticVol")
 	})
 	})
 }
 }