Skip to content

Commit 2d0de05

Browse files
committed
Change requested by Dmitrii
- Use automated approach to find all mods, rather than manual
1 parent ee12e04 commit 2d0de05

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

Makefile.Common

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -42,14 +42,9 @@ IMPI=impi
4242
BUILD_TYPE?=release
4343

4444
# COVER_PKGS is the list of packages to include in the test coverage
45-
MAIN_PKGS := $(shell go list ./... | tr "\n" ",")
46-
SIGNALFX_AGENT_PKGS := $(shell cd internal/signalfx-agent && go list ./... | tr "\n" ",")
47-
TOOLS_PKGS := $(shell cd internal/tools && go list ./... | tr "\n" ",")
48-
DOTNET_DEPLOYER_PKGS := $(shell cd packaging/dotnet-instr-deployer-add-on && go list ./... | tr "\n" ",")
49-
SMARTAGENT_EXTENSION_PKGS := $(shell cd pkg/extension/smartagentextension && go list ./... | tr "\n" ",")
50-
TIMESTAMP_PROCESSOR_PKGS := $(shell cd pkg/processor/timestampprocessor && go list ./... | tr "\n" ",")
51-
SMARTAGENT_RECEIVER_PKGS := $(shell cd pkg/receiver/smartagentreceiver && go list ./... | tr "\n" ",")
52-
COVER_PKGS := $(MAIN_PKGS)$(SIGNALFX_AGENT_PKGS)$(TOOLS_PKGS)$(DOTNET_DEPLOYER_PKGS)$(SMARTAGENT_EXTENSION_PKGS)$(TIMESTAMP_PROCESSOR_PKGS)$(SMARTAGENT_RECEIVER_PKGS)
45+
EXCLUDE_MODS=-not -path "./examples/*" -not -path "./tests/*"
46+
FIND_MOD_ARGS=-type f -name "go.mod"
47+
COVER_PKGS := $(shell find . $(EXCLUDE_MODS) $(FIND_MOD_ARGS) -execdir $(GOCMD) list ./... \; | tr "\n" "," )
5348

5449
COVER_DIR?=$(PWD)/coverage
5550
COVER_OPTS?=-cover -covermode=atomic -coverpkg $(COVER_PKGS) -args -test.gocoverdir="$(COVER_DIR)"

0 commit comments

Comments
 (0)