Skip to content

Commit

Permalink
fix error when computing coverage
Browse files Browse the repository at this point in the history
Some packages can contain both external and internal tests. Listing these
packages twice causes us to create two targets (which fails).

Instead, use a single go list statement.
  • Loading branch information
Stebalien committed Oct 12, 2020
1 parent a6c1598 commit 3df743a
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions coverage/Rules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ endif
.PHONY: $(d)/coverage_deps

# unit tests coverage
UTESTS_$(d) := $(shell $(GOCC) list -f '{{if (len .TestGoFiles)}}{{.ImportPath}}{{end}}' $(go-flags-with-tags) ./...)
UTESTS_$(d) += $(shell $(GOCC) list -f '{{if (len .XTestGoFiles)}}{{.ImportPath}}{{end}}' $(go-flags-with-tags) ./... | grep -v go-ipfs/vendor | grep -v go-ipfs/Godeps)
UTESTS_$(d) := $(shell $(GOCC) list -f '{{if (or (len .TestGoFiles) (len .XTestGoFiles))}}{{.ImportPath}}{{end}}' $(go-flags-with-tags) ./... | grep -v go-ipfs/vendor | grep -v go-ipfs/Godeps)

UCOVER_$(d) := $(addsuffix .coverprofile,$(addprefix $(d)/unitcover/, $(subst /,_,$(UTESTS_$(d)))))

Expand Down

0 comments on commit 3df743a

Please sign in to comment.