Skip to content

[release-4.19] OCPBUGS-57086: [Default Catalog Consistency Test]: Cherry-Picks up 4.17 #374

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: release-4.19
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions openshift/default-catalog-consistency/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Binaries for programs and plugins
bin/*

# Output from tests
*.xml
15 changes: 12 additions & 3 deletions openshift/default-catalog-consistency/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,20 @@ help: #HELP Display essential help.
@awk 'BEGIN {FS = ":[^#]*#HELP"; printf "\nUsage:\n make \033[36m<target>\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

Expand Down
4 changes: 1 addition & 3 deletions openshift/default-catalog-consistency/pkg/check/all.go
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down