Skip to content

Commit

Permalink
Add go-verify target
Browse files Browse the repository at this point in the history
Test go depedencies on test target by adding the go-verify target
  • Loading branch information
razo7 committed Dec 31, 2024
1 parent cf304d1 commit cf9d306
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ ENVTEST = $(shell pwd)/bin/setup-envtest
# Use TEST_OPS to pass further options to `go test` (e.g. -gingo.v and/or -ginkgo.focus)
export TEST_OPS ?= ""
.PHONY: test
test: envtest generate fix-imports manifests fmt vet ## Run tests.
test: go-verify envtest generate fix-imports manifests fmt vet ## Run tests.
KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) -p path --bin-dir $(PROJECT_DIR)/testbin)" \
KUBEBUILDER_CONTROLPLANE_STOP_TIMEOUT="60s"\
go test ./api/... ./controllers/... ./pkg/... -coverprofile cover.out -v ${TEST_OPS}
Expand Down Expand Up @@ -488,18 +488,22 @@ container-build: docker-build bundle-build ## Build containers
container-push: ## Push containers (NOTE: catalog can't be build before bundle was pushed)
make docker-push bundle-push catalog-build catalog-push

.PHONY: tidy
tidy: # Run go mod tidy - add missing and remove unused modules.
go mod tidy

.PHONY: vendor
vendor: ## Runs go mod vendor
vendor: # Run go mod vendor - make vendored copy of dependencies.
go mod vendor

.PHONY: tidy
tidy: ## Runs go mod tidy
go mod tidy
.PHONY: go-verify
go-verify: tidy vendor # Run go mod verify - verify dependencies have expected content
go mod verify

.PHONY:verify-vendor
verify-vendor: tidy vendor verify-no-changes ##Verifies vendor and tidy didn't cause changes
.PHONY: verify-vendor
verify-vendor: go-verify verify-no-changes ##Verifies vendor and tidy didn't cause changes

.PHONY:verify-bundle
.PHONY: verify-bundle
verify-bundle: manifests bundle bundle-reset verify-no-changes ##Verifies bundle and manifests didn't cause changes

# Revert all version or build date related changes
Expand Down

0 comments on commit cf9d306

Please sign in to comment.