Skip to content

Commit

Permalink
Add test-cover target
Browse files Browse the repository at this point in the history
  • Loading branch information
Eric-Warehime committed Dec 8, 2023
1 parent db58154 commit c1744eb
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ BUILD_DIR ?= $(CURDIR)/build
PROJECT_NAME = $(shell git remote get-url origin | xargs basename -s .git)
HTTPS_GIT := https://github.com/skip-mev/block-sdk.git
DOCKER := $(shell which docker)
COVER_FILE ?= "cover.out"

###############################################################################
### Test App ###
Expand Down Expand Up @@ -128,6 +129,15 @@ test-integration: $(TEST_INTEGRATION_DEPS)
test: use-main
@go test -v -race $(shell go list ./... | grep -v tests/)

test-cover: tidy
@echo Running unit tests and creating coverage report...
@go test -mod=readonly -v -timeout 30m -coverprofile=$(COVER_FILE) -covermode=atomic $(shell go list ./... | grep -v tests/)
@sed -i '/.pb.go/d' $(COVER_FILE)
@sed -i '/.pulsar.go/d' $(COVER_FILE)
@sed -i '/.proto/d' $(COVER_FILE)
@sed -i '/.pb.gw.go/d' $(COVER_FILE)


.PHONY: test test-integration

###############################################################################
Expand Down

0 comments on commit c1744eb

Please sign in to comment.