Skip to content

Commit

Permalink
feat: add test coverage report for unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mhrabovcin committed Apr 19, 2023
1 parent 1ab2da7 commit e58ec5f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,4 @@

*-kubeconfig
dist
unit-tests.xml
9 changes: 7 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ export DOCKERHUB_ORG ?= mhrabovcin
export GIT_TREE_STATE ?=

.PHONY: test
test:
go test ./...
test: tools.gotestsum
gotestsum --format pkgname --junitfile unit-tests.xml -- -coverprofile=cover.out ./... && \
go tool cover -func=cover.out

.PHONY: lint
lint:
Expand Down Expand Up @@ -44,3 +45,7 @@ release-snapshot:
--clean \
--parallelism=$(GORELEASER_PARALLELISM) \
--timeout=60m

.PHONY: tools.gotestsum
tools.gotestsum:
go install gotest.tools/gotestsum@v1.10.0

0 comments on commit e58ec5f

Please sign in to comment.