From 01b3f7f6dc8c27aa0f50727401c1c14c818aa402 Mon Sep 17 00:00:00 2001 From: Mario Valderrama <15158349+avorima@users.noreply.github.com> Date: Wed, 24 Jan 2024 14:05:21 +0100 Subject: [PATCH] fly-by: Allow specifying packages to test (#83) * fly-by: Allow specifying packages to test * fly-by: Use k8s 1.28.0 binaries for testing --- Makefile | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 953d86e5..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 @@ -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.