diff --git a/openshift/default-catalog-consistency/.gitignore b/openshift/default-catalog-consistency/.gitignore new file mode 100644 index 000000000..308014c55 --- /dev/null +++ b/openshift/default-catalog-consistency/.gitignore @@ -0,0 +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 675b8f33a..332106636 100644 --- a/openshift/default-catalog-consistency/Makefile +++ b/openshift/default-catalog-consistency/Makefile @@ -22,11 +22,20 @@ 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 +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 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(), } } 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())