Skip to content

Commit

Permalink
chore: use test-cov script to run test and generate report
Browse files Browse the repository at this point in the history
Signed-off-by: Abhinandan Purkait <[email protected]>
  • Loading branch information
Abhinandan-Purkait committed Mar 18, 2024
1 parent 9e65a85 commit 8136f0e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
# list only csi source code directories
PACKAGES = $(shell go list ./... | grep -v 'pkg/generated')

UNIT_TEST_PACKAGES = $(shell go list ./... | grep -v 'pkg/generated\|tests')
# UNIT_TEST_PACKAGES = $(shell go list ./... | grep -v 'pkg/generated\|tests')

# Lint our code. Reference: https://golang.org/cmd/vet/
VETARGS?=-asmdecl -atomic -bool -buildtags -copylocks -methods \
Expand Down Expand Up @@ -110,7 +110,7 @@ format:
.PHONY: test
test: format
@echo "--> Running go test" ;
@go test $(UNIT_TEST_PACKAGES) -cover -coverpkg=./... -covermode=atomic -coverprofile=coverage.txt
@./buildscripts/test-cov.sh


.PHONY: deps
Expand Down
2 changes: 1 addition & 1 deletion buildscripts/test-cov.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
set -e
echo "" > coverage.txt

for d in $(go list ./... | grep -v 'vendor\|pkg/apis\|pkg/generated\|tests'); do
for d in $(go list ./... | grep -v 'pkg/generated\|tests'); do
#TODO - Include -race while creating the coverage profile.
go test -coverprofile=profile.out -covermode=atomic $d
if [ -f profile.out ]; then
Expand Down

0 comments on commit 8136f0e

Please sign in to comment.