diff --git a/magefiles/magefile.go b/magefiles/magefile.go index 454c0fa9d7..d2d332495d 100644 --- a/magefiles/magefile.go +++ b/magefiles/magefile.go @@ -294,7 +294,7 @@ func (ci CI) TestE2E() error { } func RunE2ETests() error { - labelFilter := utils.GetEnv("E2E_TEST_SUITE_LABEL", "!upgrade-create && !upgrade-verify && !upgrade-cleanup && !release-pipelines") + labelFilter := utils.GetEnv("E2E_TEST_SUITE_LABEL", "!upgrade-create && !upgrade-verify && !upgrade-cleanup") return runTests(labelFilter, "e2e-report.xml") } diff --git a/tests/release/pipelines/push_to_external_registry.go b/tests/release/pipelines/push_to_external_registry.go index d644a1600c..74a6990f94 100644 --- a/tests/release/pipelines/push_to_external_registry.go +++ b/tests/release/pipelines/push_to_external_registry.go @@ -172,10 +172,9 @@ var _ = framework.ReleasePipelinesSuiteDescribe("Push to external registry", Lab component, err := fw.AsKubeAdmin.HasController.GetComponent(component.GetName(), devNamespace) Expect(err).ShouldNot(HaveOccurred(), fmt.Sprintf("could not get component %s in the %s namespace", component.GetName(), devNamespace)) containerImageDigest := strings.Split(component.Spec.ContainerImage, "@")[1] - - imageDigest, err := releasecommon.GetDigestWithTagInQuay(releasecommon.ReleasedImagePushRepo + ":latest") - Expect(err).ShouldNot(HaveOccurred(), fmt.Sprintf("failed while getting Digest for quay image %s with error: %+v", releasecommon.ReleasedImagePushRepo + ":latest", err)) - Expect(imageDigest).To(Equal(containerImageDigest)) + digestExist, err := releasecommon.DoesDigestExistsInQuay(releasecommon.ReleasedImagePushRepo + "@" + containerImageDigest) + Expect(err).ShouldNot(HaveOccurred(), fmt.Sprintf("failed while getting Digest for quay image %s with error: %+v", releasecommon.ReleasedImagePushRepo + "@" + containerImageDigest, err)) + Expect(digestExist).To(BeTrue()) }) It("verifies that a Release is marked as succeeded.", func() { diff --git a/tests/release/quay.go b/tests/release/quay.go index 1da691b64b..8ba51689f9 100644 --- a/tests/release/quay.go +++ b/tests/release/quay.go @@ -16,25 +16,25 @@ var ( quayClient = quay.NewQuayClient(&http.Client{Transport: &http.Transport{}}, quayToken, quayApiUrl) ) -// imageURL format example: quay.io/redhat-appstudio-qe/devfile-go-rhtap-uvv7:latest -func GetDigestWithTagInQuay(imageURL string) (string, error) { +// imageURL format example: quay.io/redhat-appstudio-qe/dcmetromap@sha256:386e8280dad01b86f01eaf4ed3a821c82626ec3dd7783c68b2cf558a15431a0f +func DoesDigestExistsInQuay(imageURL string) (bool, error) { urlParts := strings.Split(imageURL, ":") if len(urlParts) != 2 { - return "", fmt.Errorf("image URL %s has incorrect format", imageURL) + return false, fmt.Errorf("image URL %s has incorrect format", imageURL) } repoParts := strings.Split(urlParts[0], "/") if len(repoParts) <= 2 { - return "", fmt.Errorf("image URL %s is not complete", imageURL) + return false, fmt.Errorf("image URL %s is not complete", imageURL) } - repoName := strings.Join(repoParts[2:], "/") - tagList, _, err := quayClient.GetTagsFromPage(quayOrg, repoName, 0) - if err != nil { - return "", err - } - for _, tag := range tagList { - if tag.Name == urlParts[1] { - return tag.ManifestDigest, nil - } - } - return "", fmt.Errorf("no image is found") + tagList, _, err := quayClient.GetTagsFromPage(repoParts[1], repoParts[2], 0) + if err != nil { + return false, err + } + for _, tag := range tagList { + if tag.ManifestDigest == urlParts[1] { + return true, nil + } + } + return false, fmt.Errorf("no image is found") } +