Skip to content

Commit

Permalink
chore: introduce Makefile wrapper to run unit tests
Browse files Browse the repository at this point in the history
Signed-off-by: odubajDT <ondrej.dubaj@dynatrace.com>
  • Loading branch information
odubajDT committed Sep 11, 2023
1 parent bd15001 commit f3cc13c
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 0 deletions.
4 changes: 4 additions & 0 deletions klt-cert-manager/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,10 @@ vet: ## Run go vet against code.
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

.PHONY: run-unit-tests
run-unit-tests:
go test ./... -coverprofile cover.out

##@ Build

.PHONY: build
Expand Down
4 changes: 4 additions & 0 deletions lifecycle-operator/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,10 @@ test: manifests fmt vet generate envtest ## Run tests.
cat cover-cmd.out cover-main.out cover-pkg.out cover-apis.out >> cover.out
rm cover-cmd.out cover-pkg.out cover-main.out cover-apis.out

.PHONY: run-unit-tests
run-unit-tests:
go test $(shell go list ./... | grep -v /test/) -coverprofile cover.out

.PHONY: component-test
component-test: manifests generate envtest ## Run tests.
KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) -p path)" go test ./test/component/app/... -v -timeout 30m -coverprofile cover-app.out -coverpkg "github.com/keptn/lifecycle-toolkit/lifecycle-operator/controllers/lifecycle/keptnapp/..."
Expand Down
4 changes: 4 additions & 0 deletions metrics-operator/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,10 @@ fmt: ## Run go fmt against code.
vet: ## Run go vet against code.
go vet ./...

.PHONY: run-unit-tests
run-unit-tests:
go test ./... -coverprofile cover.out

.PHONY: test
test: manifests generate fmt vet envtest ## Run tests.
KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) -p path)" go test ./... -coverprofile cover.out
Expand Down
4 changes: 4 additions & 0 deletions scheduler/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,10 @@ vet: ## Run go vet against code.
e2e-test: manifests envtest ## Run tests.
go test ./test/e2e -v -coverprofile cover.out

.PHONY: run-unit-tests
run-unit-tests:
go test $(shell go list ./... | grep -v /test/)

.PHONY: test
test: manifests fmt vet envtest## Run tests.
go test ./pkg/... -coverprofile cover-pkg.out
Expand Down

0 comments on commit f3cc13c

Please sign in to comment.