From 331a60bb6208dfde1c4656adeb12bcba35fdd255 Mon Sep 17 00:00:00 2001 From: Djordje Lukic Date: Fri, 11 Dec 2020 16:03:39 +0100 Subject: [PATCH] Add test for compose pull Signed-off-by: Djordje Lukic --- tests/compose-e2e/compose_test.go | 13 ++++++++++++- .../fixtures/simple-composefile/docker-compose.yml | 7 +++++++ 2 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 tests/compose-e2e/fixtures/simple-composefile/docker-compose.yml diff --git a/tests/compose-e2e/compose_test.go b/tests/compose-e2e/compose_test.go index 6328a14d4..b5fabb611 100644 --- a/tests/compose-e2e/compose_test.go +++ b/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")) +} diff --git a/tests/compose-e2e/fixtures/simple-composefile/docker-compose.yml b/tests/compose-e2e/fixtures/simple-composefile/docker-compose.yml new file mode 100644 index 000000000..0d38631a2 --- /dev/null +++ b/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