From e92a3e27461d3f2659095fd95396482088b8cccc Mon Sep 17 00:00:00 2001 From: Camila Macedo <7708031+camilamacedo86@users.noreply.github.com> Date: Mon, 2 Jun 2025 09:24:27 +0100 Subject: [PATCH 1/3] UPSTREAM: : [Default Catalog Consistency Test]: fix junit output format to allow generate xml --- .../default-catalog-consistency/.gitignore | 2 ++ .../default-catalog-consistency/Makefile | 22 ++++++++++++++++--- 2 files changed, 21 insertions(+), 3 deletions(-) create mode 100644 openshift/default-catalog-consistency/.gitignore diff --git a/openshift/default-catalog-consistency/.gitignore b/openshift/default-catalog-consistency/.gitignore new file mode 100644 index 000000000..de1212c05 --- /dev/null +++ b/openshift/default-catalog-consistency/.gitignore @@ -0,0 +1,2 @@ +# Binaries for programs and plugins +bin/* diff --git a/openshift/default-catalog-consistency/Makefile b/openshift/default-catalog-consistency/Makefile index 675b8f33a..cfbff2dc4 100644 --- a/openshift/default-catalog-consistency/Makefile +++ b/openshift/default-catalog-consistency/Makefile @@ -23,10 +23,26 @@ help: #HELP Display essential help. #SECTION Tests +# Set the Ginkgo binary path. Assumes it's installed via `go install` +GOBIN ?= $(shell go env GOBIN) +ifeq ($(GOBIN),) + GOBIN := $(shell go env GOPATH)/bin +endif + +TOOLS_BIN_DIR := $(CURDIR)/bin +GINKGO := $(TOOLS_BIN_DIR)/ginkgo + +.PHONY: install-tools +install-tools: $(GINKGO) #HELP Build vendored CLI tools + +$(GINKGO): vendor/modules.txt + go build -mod=vendor -o $(GINKGO) ./vendor/github.com/onsi/ginkgo/v2/ginkgo + .PHONY: test-catalog -test-catalog: #HELP Run the set of tests to validate the quality of catalogs - E2E_GINKGO_OPTS="$(if $(ARTIFACT_DIR),--output-dir='$(ARTIFACT_DIR)') --junit-report junit_e2e.xml" \ - go test -count=1 -v ./test/validate/...; +test-catalog: install-tools $(GINKGO) #HELP Run the set of tests to validate the quality of catalogs + $(GINKGO) $(if $(ARTIFACT_DIR),--output-dir='$(ARTIFACT_DIR)') \ + --junit-report=junit_olm.xml ./test/validate/... + #SECTION Development From c54f28dd98ac091106e6da4baeb73647e1c64043 Mon Sep 17 00:00:00 2001 From: Camila Macedo <7708031+camilamacedo86@users.noreply.github.com> Date: Wed, 4 Jun 2025 13:34:00 +0100 Subject: [PATCH 2/3] UPSTREAM: : [Default Catalog Consistency Test]: Enable CatalogChecks --- openshift/default-catalog-consistency/pkg/check/all.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/openshift/default-catalog-consistency/pkg/check/all.go b/openshift/default-catalog-consistency/pkg/check/all.go index 396742676..0ad43dcc1 100644 --- a/openshift/default-catalog-consistency/pkg/check/all.go +++ b/openshift/default-catalog-consistency/pkg/check/all.go @@ -5,8 +5,6 @@ func AllChecks() Checks { return Checks{ ImageChecks: AllImageChecks(), FilesystemChecks: AllFilesystemChecks(), - // TODO: Enable those tests when community-operator-index and certified-operator-index - // have the issues fixed, see: https://issues.redhat.com/browse/CLOUDWF-11022 - // CatalogChecks: AllCatalogChecks(), + CatalogChecks: AllCatalogChecks(), } } From 180a863fb28fbd9a9c2e5a7a91ed20e90e6804ca Mon Sep 17 00:00:00 2001 From: Camila Macedo <7708031+camilamacedo86@users.noreply.github.com> Date: Wed, 4 Jun 2025 13:39:58 +0100 Subject: [PATCH 3/3] UPSTREAM: : [Default Catalog Consistency Test]: Rename Tests suite and small cleanups --- openshift/default-catalog-consistency/.gitignore | 3 +++ openshift/default-catalog-consistency/Makefile | 7 ------- .../test/validate/suite_test.go | 4 ++-- 3 files changed, 5 insertions(+), 9 deletions(-) diff --git a/openshift/default-catalog-consistency/.gitignore b/openshift/default-catalog-consistency/.gitignore index de1212c05..308014c55 100644 --- a/openshift/default-catalog-consistency/.gitignore +++ b/openshift/default-catalog-consistency/.gitignore @@ -1,2 +1,5 @@ # Binaries for programs and plugins bin/* + +# Output from tests +*.xml diff --git a/openshift/default-catalog-consistency/Makefile b/openshift/default-catalog-consistency/Makefile index cfbff2dc4..332106636 100644 --- a/openshift/default-catalog-consistency/Makefile +++ b/openshift/default-catalog-consistency/Makefile @@ -22,13 +22,6 @@ help: #HELP Display essential help. @awk 'BEGIN {FS = ":[^#]*#HELP"; printf "\nUsage:\n make \033[36m\033[0m\n\n"} /^[a-zA-Z_0-9-]+:.*#HELP / { printf " \033[36m%-17s\033[0m %s\n", $$1, $$2 } ' $(MAKEFILE_LIST) #SECTION Tests - -# Set the Ginkgo binary path. Assumes it's installed via `go install` -GOBIN ?= $(shell go env GOBIN) -ifeq ($(GOBIN),) - GOBIN := $(shell go env GOPATH)/bin -endif - TOOLS_BIN_DIR := $(CURDIR)/bin GINKGO := $(TOOLS_BIN_DIR)/ginkgo diff --git a/openshift/default-catalog-consistency/test/validate/suite_test.go b/openshift/default-catalog-consistency/test/validate/suite_test.go index 295e3339e..4276f02ce 100644 --- a/openshift/default-catalog-consistency/test/validate/suite_test.go +++ b/openshift/default-catalog-consistency/test/validate/suite_test.go @@ -18,10 +18,10 @@ import ( func TestSuite(t *testing.T) { RegisterFailHandler(Fail) - RunSpecs(t, "Validate Catalog Test Suite") + RunSpecs(t, "OLM-Catalog-Validation") } -var _ = Describe("Check Catalog Consistency", func() { +var _ = Describe("OLM-Catalog-Validation", func() { catalogsPath := "../../../catalogd/kustomize/overlays/openshift/catalogs" images, err := utils.ParseImageRefsFromCatalog(catalogsPath) Expect(err).ToNot(HaveOccurred())