From e24d274bbc1135c05b3e396a1ee74b0159e7f845 Mon Sep 17 00:00:00 2001 From: Vedant Koditkar Date: Sat, 5 Mar 2022 23:39:29 +0530 Subject: [PATCH] Fix breaking TestComposePull test case Signed-off-by: Vedant Koditkar --- pkg/e2e/compose_test.go | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/pkg/e2e/compose_test.go b/pkg/e2e/compose_test.go index 98415aa5..81de2396 100644 --- a/pkg/e2e/compose_test.go +++ b/pkg/e2e/compose_test.go @@ -127,8 +127,28 @@ func TestComposePull(t *testing.T) { res := c.RunDockerOrExitError("compose", "--project-directory", "fixtures/simple-composefile", "pull") output := res.Combined() - assert.Assert(t, strings.Contains(output, "simple Pulled")) - assert.Assert(t, strings.Contains(output, "another Pulled")) + expected := []string{ + "Skipped - No image to be pulled", + "Skipped - Image is already present locally", + "Skipped - Image is already being pulled by", + "simple Pulled", + "another Pulled", + } + + assert.Assert(t, contains(output, expected)) +} + +func contains(str string, array []string) bool { + found := false + + for _, val := range array { + if strings.Contains(str, val) { + found = true + break + } + } + + return found } func TestDownComposefileInParentFolder(t *testing.T) {