From da2c516a0ac6e8aaa8025d9f93f9908218173359 Mon Sep 17 00:00:00 2001 From: Camila Macedo <7708031+camilamacedo86@users.noreply.github.com> Date: Fri, 15 Aug 2025 17:18:07 +0100 Subject: [PATCH 1/2] UPSTREAM: : Add verify for bindata --- openshift/tests-extension/Makefile | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/openshift/tests-extension/Makefile b/openshift/tests-extension/Makefile index 05693ee40..bba678464 100644 --- a/openshift/tests-extension/Makefile +++ b/openshift/tests-extension/Makefile @@ -42,7 +42,7 @@ TOOLS_BIN_DIR := $(CURDIR)/bin #SECTION Development .PHONY: verify #HELP To verify the code -verify: tidy fmt vet lint +verify: tidy fmt vet lint verify-bindata .PHONY: tidy #HELP Run go mod tidy. tidy: @@ -148,3 +148,10 @@ verify-metadata: update-metadata echo "ERROR: Metadata is out of date. Please run 'make build-update' and commit the result."; \ exit 1; \ fi + +.PHONY: verify-bindata #HELP To verify that the bindata was properly update +verify-bindata: build bindata + @if ! git diff --exit-code $(METADATA); then \ + echo "ERROR: bindata is out of date. Please run 'make build-update' and commit the result."; \ + exit 1; \ + fi From fbae9249d23595e1e46979af9c69a1d57d5c67c1 Mon Sep 17 00:00:00 2001 From: Camila Macedo <7708031+camilamacedo86@users.noreply.github.com> Date: Fri, 15 Aug 2025 17:42:48 +0100 Subject: [PATCH 2/2] UPSTREAM: : OTE- add bindata to verify --- openshift/tests-extension/Makefile | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/openshift/tests-extension/Makefile b/openshift/tests-extension/Makefile index bba678464..f94ba7af8 100644 --- a/openshift/tests-extension/Makefile +++ b/openshift/tests-extension/Makefile @@ -42,7 +42,7 @@ TOOLS_BIN_DIR := $(CURDIR)/bin #SECTION Development .PHONY: verify #HELP To verify the code -verify: tidy fmt vet lint verify-bindata +verify: tidy fmt vet lint verify-metadata .PHONY: tidy #HELP Run go mod tidy. tidy: @@ -84,12 +84,12 @@ pkg/bindata/catalog/catalog.go: $(shell find testdata/catalog -type f) # It prevents various FIPS compliance policies from being applied to this compilation. # Do not set globally. .PHONY: build -build: bindata #HELP Build the extended tests binary +build: #HELP Build the extended tests binary @mkdir -p $(TOOLS_BIN_DIR) GO_COMPLIANCE_POLICY="exempt_all" go build -ldflags "$(LDFLAGS)" -mod=vendor -o $(TOOLS_BIN_DIR)/olmv1-tests-ext ./cmd/... .PHONY: update-metadata -update-metadata: #HELP Build and run 'update-metadata' to generate test metadata +update-metadata: build bindata #HELP Build and run 'update-metadata' to generate test metadata $(TOOLS_BIN_DIR)/olmv1-tests-ext update --component openshift:payload:olmv1 $(MAKE) clean-metadata @@ -142,16 +142,10 @@ clean-metadata: #HELP Remove 'codeLocations' from metadata JSON @echo "Cleaning metadata (removing codeLocations)..." @jq 'map(del(.codeLocations))' $(METADATA) > $(METADATA).tmp && mv $(METADATA).tmp $(METADATA) -.PHONY: verify-metadata #HELP To verify that the metadata was properly update +.PHONY: verify-metadata #HELP To verify that the metadata and bindata was properly update verify-metadata: update-metadata - @if ! git diff --exit-code $(METADATA); then \ + @if ! git diff --exit-code >&/dev/null; then \ echo "ERROR: Metadata is out of date. Please run 'make build-update' and commit the result."; \ exit 1; \ fi -.PHONY: verify-bindata #HELP To verify that the bindata was properly update -verify-bindata: build bindata - @if ! git diff --exit-code $(METADATA); then \ - echo "ERROR: bindata is out of date. Please run 'make build-update' and commit the result."; \ - exit 1; \ - fi