Skip to content

Commit

Permalink
Makefile: use all build tags in e2e coverage mode
Browse files Browse the repository at this point in the history
  • Loading branch information
ptrus committed Nov 2, 2023
1 parent 41b7376 commit 9132d9d
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions go/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,14 @@ ifneq ($(OASIS_NO_ROCKSDB), 1)
GO_TAGS := $(GO_TAGS)rocksdb,grocksdb_clean_link
endif

# Include e2ecoverage tag if configured.
ifeq ($(GO_BUILD_E2E_COVERAGE),1)
ifneq ($(GO_TAGS),)
GO_TAGS := $(GO_TAGS),
endif
GO_TAGS := $(GO_TAGS)e2ecoverage
endif

# If GO_TAGS is not empty, append it to GO_EXTRA_FLAGS.
ifneq ($(GO_TAGS),)
GO_EXTRA_FLAGS += -tags "$(GO_TAGS)"
Expand All @@ -49,7 +57,7 @@ $(go-binaries):
@$(GO) build $(GOFLAGS) $(GO_EXTRA_FLAGS) -o ./$@/$(notdir $@) ./$@
ifeq ($(GO_BUILD_E2E_COVERAGE),1)
@$(ECHO) "$(MAGENTA)*** Building $@ with E2E coverage...$(OFF)"
@$(GO) test $(GOFLAGS) -c -tags e2ecoverage -covermode=atomic -coverpkg=./... -o ./$@/$(notdir $@).test ./$@
@$(GO) test $(GOFLAGS) -c -tags $(GO_TEST_FLAGS) -covermode=atomic -coverpkg=./... -o ./$@/$(notdir $@).test ./$@
endif

build: $(go-binaries)
Expand Down Expand Up @@ -113,7 +121,7 @@ test: $(test-targets)
# Test without caching.
force-test:
@$(ECHO) "$(CYAN)*** Running Go unit tests in force mode...$(OFF)"
@$(MAKE) test GO_TEST_FLAGS=-count=1
@$(MAKE) test GO_TEST_FLAGS += -count=1

# Clean.
clean:
Expand Down

0 comments on commit 9132d9d

Please sign in to comment.