From 4ba9874fb97ceed89132cc3d47063736e9b7af54 Mon Sep 17 00:00:00 2001 From: Mario Valderrama Date: Wed, 24 Jan 2024 12:07:07 +0100 Subject: [PATCH 1/2] fly-by: Allow specifying packages to test --- Makefile | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 953d86e5..e92a4e8c 100644 --- a/Makefile +++ b/Makefile @@ -60,9 +60,12 @@ vet: ## Run go vet against code. lint: ## Run lint. go run -modfile ./hack/tools/go.mod github.com/golangci/golangci-lint/cmd/golangci-lint run --timeout 5m -c .golangci.yml +# Package names to test +WHAT ?= ./... + .PHONY: test -test: manifests generate fmt vet envtest ## Run tests. - KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) --bin-dir $(LOCALBIN) -p path)" go test ./... -coverprofile cover.out +test: manifests generate fmt vet envtest ## Run tests. Specify packages to test using WHAT. + KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) --bin-dir $(LOCALBIN) -p path)" go test $(WHAT) -coverprofile cover.out .PHONY: mockgen mockgen: ## Generate mocks. From bf90665ca90e333fe07f5e774507fe4d357b469c Mon Sep 17 00:00:00 2001 From: Mario Valderrama Date: Wed, 24 Jan 2024 12:08:20 +0100 Subject: [PATCH 2/2] fly-by: Use k8s 1.28.0 binaries for testing --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index e92a4e8c..fc4ac0f8 100644 --- a/Makefile +++ b/Makefile @@ -2,7 +2,7 @@ # Image URL to use all building/pushing image targets IMG ?= controller:latest # ENVTEST_K8S_VERSION refers to the version of kubebuilder assets to be downloaded by envtest binary. -ENVTEST_K8S_VERSION = 1.26.1 +ENVTEST_K8S_VERSION = 1.28.0 TOOLS_DIR := hack/tools