File tree Expand file tree Collapse file tree 2 files changed +15
-1
lines changed
Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Original file line number Diff line number Diff line change 99bin
1010wf-unprocessed *
1111wf-processed *
12- * . * .old
12+ * . * .old
13+ coverage_results
Original file line number Diff line number Diff line change @@ -73,6 +73,10 @@ SRC_DIRS := ./apricot ./cmd/* ./core ./coconut ./executor ./common ./configurati
7373TEST_DIRS := ./configuration/cfgbackend ./configuration/componentcfg ./core/task ./core/workflow
7474GO_TEST_DIRS := ./core/repos ./core/integration/dcs
7575
76+ coverage:COVERAGE_PREFIX := ./coverage_results
77+ coverage:GOTEST_COVERAGE_FILE := $(COVERAGE_PREFIX ) /gotest.out
78+ coverage:GOTEST_COVERAGE_FILE_HTML := $(COVERAGE_PREFIX ) /gotest.html
79+
7680# Use linker flags to provide version/build settings to the target
7781PROD :=-X=$(REPOPATH ) /common/product
7882EXTLDFLAGS :="-static"
@@ -153,6 +157,15 @@ test:
153157 @echo -e "\n[gotest] \033[1;33mgo test -v\033[0m $(GO_TEST_DIRS)\033[0m"
154158 @$(BUILD_FLAGS) go test -v $(GO_TEST_DIRS)
155159
160+ coverage :
161+ mkdir -p $(COVERAGE_PREFIX )
162+
163+ # -ginkgo.show-node-events is not necessary for coverage as it only increases verbosity of logs
164+ @echo -e "\n[gotest] \033[1;33mgo test -coverprofile=$(GOTEST_COVERAGE_FILE) -v\033[0m $(TEST_DIRS) $(GO_TEST_DIRS)\033[0m"
165+ @$(BUILD_FLAGS) go test -coverprofile=$(GOTEST_COVERAGE_FILE) -v $(TEST_DIRS) $(GO_TEST_DIRS)
166+ @echo -e "\n[gotest] \033[1;33mgo tool cover -html=$(GOTEST_COVERAGE_FILE) -o $(GOTEST_COVERAGE_FILE_HTML)\033[0m"
167+ @go tool cover -html=$(GOTEST_COVERAGE_FILE) -o $(GOTEST_COVERAGE_FILE_HTML)
168+
156169debugtest :
157170 @echo -e " [Ginkgo] \033[1;33mgo test -v\033[0m $( TEST_DIRS) \033[0m"
158171 @$(BUILD_FLAGS ) go test -v $(TEST_DIRS ) -ginkgo.v -ginkgo.trace -ginkgo.show-node-events
You can’t perform that action at this time.
0 commit comments