Skip to content

Commit e3812c3

Browse files
authored
Adding the possibility to run a single-package in unit-tests. (kubernetes-sigs#90)
In order to run only the `filter` package tests for example, use: ``` make unit-test TEST=github.com/qbarrand/oot-operator/internal/filter ``` Signed-off-by: Yoni Bettan <[email protected]>
1 parent 06137e5 commit e3812c3

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Makefile

+3-1
Original file line numberDiff line numberDiff line change
@@ -107,9 +107,11 @@ fmt: ## Run go fmt against code.
107107
vet: ## Run go vet against code.
108108
go vet ./...
109109

110+
TEST ?= ./...
111+
110112
.PHONY: test
111113
unit-test: manifests generate lint vet envtest ## Run tests.
112-
KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) -p path)" go test ./... -coverprofile cover.out
114+
KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) -p path)" go test $(TEST) -coverprofile cover.out
113115

114116
.PHONY: lint
115117
lint: golangci-lint ## Run golangci-lint against code.

0 commit comments

Comments
 (0)