From 24626a026d57471138970a8de559920b78dc88f6 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 f61052911c5579e94272ac7c669e2382f718b95b 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 4c17d800aebc0285349b36abfc4387cb85c73822 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 705851f8f..d0c55cda4 100644 --- a/openshift/default-catalog-consistency/test/validate/suite_test.go +++ b/openshift/default-catalog-consistency/test/validate/suite_test.go @@ -18,7 +18,7 @@ import ( func TestSuite(t *testing.T) { RegisterFailHandler(Fail) - RunSpecs(t, "Validate Catalog Test Suite") + RunSpecs(t, "OLM-Catalog-Validation") } // images is a list of image references to be validated. @@ -29,7 +29,7 @@ var images = []string{ "registry.redhat.io/redhat/redhat-operator-index:v4.18", } -var _ = Describe("Check Catalog Consistency", func() { +var _ = Describe("OLM-Catalog-Validation", func() { authPath := os.Getenv("REGISTRY_AUTH_FILE") // Force image resolution to Linux to avoid OS mismatch errors on macOS,