Skip to content

Commit

Permalink
fly-by: Allow specifying packages to test (#83)
Browse files Browse the repository at this point in the history
* fly-by: Allow specifying packages to test

* fly-by: Use k8s 1.28.0 binaries for testing
  • Loading branch information
avorima authored Jan 24, 2024
1 parent 830e386 commit 01b3f7f
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit 01b3f7f

Please sign in to comment.