Skip to content

Commit

Permalink
make: enable per-package coverage checking
Browse files Browse the repository at this point in the history
  • Loading branch information
jharveyb committed Oct 17, 2023
1 parent 77b5706 commit 3deb243
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,16 @@ cmd/tapd/tapd

# Output of the go coverage tool, specifically when used with LiteIDE
*.out
coverage.*

# Sed backup files.
*.bak

# Editor configs.
*.idea
*.iml
*.code-workspace
.vscode/

# Dependency directories (remove the comment below to include it)
vendor/
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ unit-trace:

unit-cover: $(GOACC_BIN)
@$(call print, "Running unit coverage tests.")
$(GOACC_BIN) $(GOLIST_COVER)
$(GOACC); $(COVER_HTML)

unit-race:
@$(call print, "Running unit race tests.")
Expand Down
4 changes: 4 additions & 0 deletions make/testing_flags.mk
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ LOG_TAGS =
TEST_FLAGS =
ITEST_FLAGS = -logoutput
COVER_PKG = $$(go list -deps -tags="$(DEV_TAGS)" ./... | grep '$(PKG)' | grep -v lnrpc)
COVER_HTML = go tool cover -html=coverage.txt -o coverage.html
POSTGRES_START_DELAY = 5

# If rpc option is set also add all extra RPC tags to DEV_TAGS
Expand Down Expand Up @@ -112,5 +113,8 @@ endif
# Construct the integration test command with the added build flags.
ITEST_TAGS := $(DEV_TAGS) $(RPC_TAGS) integration itest $(backend)

# Construct the coverage test command path with the added build flags.
GOACC := $(GOACC_BIN) $(COVER_PKG) -- -tags="$(DEV_TAGS) $(LOG_TAGS)" $(TEST_FLAGS)

# Construct the load test command with the added build flags.
LOADTEST_TAGS := $(DEV_TAGS) $(RPC_TAGS) loadtest

0 comments on commit 3deb243

Please sign in to comment.