Skip to content

Commit 2b0ffff

Browse files
committed
make: add ability to add additional tags
This commit lets us perform commands of the form: `make unit tags=postgres` to add additional tags to the command. This will be useful in a future where we, for example, want to run unit tests against a specific DB backend.
1 parent 824a3c2 commit 2b0ffff

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

make/testing_flags.mk

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ include make/compile_flags.mk
22

33
ITEST_FLAGS =
44
TEST_FLAGS =
5+
DEV_TAGS = dev
56

67
# Define the integration test.run filter if the icase argument was provided.
78
ifneq ($(icase),)
@@ -13,5 +14,10 @@ ifneq ($(case),)
1314
TEST_FLAGS += -test.run=$(case)
1415
endif
1516

16-
UNIT := $(GOLIST) | $(XARGS) env $(GOTEST) -tags="$(COMPILE_TAGS)" $(TEST_FLAGS)
17+
# Add any additional tags that are passed in to make.
18+
ifneq ($(tags),)
19+
DEV_TAGS += ${tags}
20+
endif
21+
22+
UNIT := $(GOLIST) | $(XARGS) env $(GOTEST) -tags="$(DEV_TAGS) $(COMPILE_TAGS)" $(TEST_FLAGS)
1723
UNIT_RACE := $(UNIT) -race

0 commit comments

Comments
 (0)