Skip to content

Commit

Permalink
Add make target for executing unit tests with test coverage (#396)
Browse files Browse the repository at this point in the history
* Add test-cov make target

* Update .gitignore

Co-authored-by: Marc Vornetran <[email protected]>

* Exclude /pkg/client from coverprofile

* update test coverage script to exclude /pkg/client and remove test-cover Script

---------

Co-authored-by: Marc Vornetran <[email protected]>
  • Loading branch information
ThomasWall03 and marc1404 authored Jan 28, 2025
1 parent 91c8d50 commit 84ae6ac
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,8 @@ tmp/
.vscode/
.kubeconfig-kind-integration

*.coverprofile
*.html

# gosec
gosec-report.sarif
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,10 @@ test: $(GINKGO)
test-integration: $(REPORT_COLLECTOR) $(SETUP_ENVTEST)
@bash $(GARDENER_HACK_DIR)/test-integration.sh ./test/integration/...

.PHONY: test-cov
test-cov:
@bash $(GARDENER_HACK_DIR)/test-cover.sh $(shell go list ./pkg/... | grep -v /pkg/client) ./cmd/...

.PHONY: generate
generate: $(VGOPATH) $(CONTROLLER_GEN)
@GARDENER_HACK_DIR=$(GARDENER_HACK_DIR) VGOPATH=$(VGOPATH) REPO_ROOT=$(REPO_ROOT) ./hack/generate-code
Expand Down

0 comments on commit 84ae6ac

Please sign in to comment.