Skip to content

Commit 01b3f7f

Browse files
authored
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
1 parent 830e386 commit 01b3f7f

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

Makefile

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# Image URL to use all building/pushing image targets
33
IMG ?= controller:latest
44
# ENVTEST_K8S_VERSION refers to the version of kubebuilder assets to be downloaded by envtest binary.
5-
ENVTEST_K8S_VERSION = 1.26.1
5+
ENVTEST_K8S_VERSION = 1.28.0
66

77
TOOLS_DIR := hack/tools
88

@@ -60,9 +60,12 @@ vet: ## Run go vet against code.
6060
lint: ## Run lint.
6161
go run -modfile ./hack/tools/go.mod github.com/golangci/golangci-lint/cmd/golangci-lint run --timeout 5m -c .golangci.yml
6262

63+
# Package names to test
64+
WHAT ?= ./...
65+
6366
.PHONY: test
64-
test: manifests generate fmt vet envtest ## Run tests.
65-
KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) --bin-dir $(LOCALBIN) -p path)" go test ./... -coverprofile cover.out
67+
test: manifests generate fmt vet envtest ## Run tests. Specify packages to test using WHAT.
68+
KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) --bin-dir $(LOCALBIN) -p path)" go test $(WHAT) -coverprofile cover.out
6669

6770
.PHONY: mockgen
6871
mockgen: ## Generate mocks.

0 commit comments

Comments
 (0)