1
0
Эх сурвалжийг харах

Add test for compose pull

Signed-off-by: Djordje Lukic <[email protected]>
Djordje Lukic 4 жил өмнө
parent
commit
331a60bb62

+ 12 - 1
tests/compose-e2e/compose_test.go

@@ -24,7 +24,7 @@ import (
 	"testing"
 	"time"
 
-	"gotest.tools/assert"
+	"gotest.tools/v3/assert"
 	"gotest.tools/v3/icmd"
 
 	. "github.com/docker/compose-cli/tests/framework"
@@ -148,6 +148,7 @@ func TestLocalComposeBuild(t *testing.T) {
 		c.RunDockerCmd("rmi", "custom-nginx")
 	})
 }
+
 func TestLocalComposeVolume(t *testing.T) {
 	c := NewParallelE2eCLI(t, binDir)
 
@@ -176,3 +177,13 @@ func TestLocalComposeVolume(t *testing.T) {
 		c.RunDockerCmd("volume", "rm", projectName+"_staticVol")
 	})
 }
+
+func TestComposePull(t *testing.T) {
+	c := NewParallelE2eCLI(t, binDir)
+
+	res := c.RunDockerOrExitError("compose", "pull", "--workdir", "fixtures/simple-composefile")
+	output := res.Combined()
+
+	assert.Assert(t, strings.Contains(output, "simple Pulled"))
+	assert.Assert(t, strings.Contains(output, "another Pulled"))
+}

+ 7 - 0
tests/compose-e2e/fixtures/simple-composefile/docker-compose.yml

@@ -0,0 +1,7 @@
+services:
+  simple:
+    image: busybox:1.27.2
+    command: top
+  another:
+    image: busybox:1.31.0-uclibc
+    command: top