Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
CODE_COVERAGE_REPORT_NAME_UNIT = $(PWD)/build/test-coverage/coverage-unit-report
CODE_COVERAGE_REPORT_FOLDER = $(PWD)/build/test-coverage
CODE_COVERAGE_REPORT_NAME_UNIT = $(CODE_COVERAGE_REPORT_FOLDER)/coverage-unit-report

.PHONY: build

Expand Down Expand Up @@ -26,13 +27,16 @@ update-readme:

update: update-readme

test-go:
$(CODE_COVERAGE_REPORT_NAME_UNIT):
mkdir -p $@

test-go: $(CODE_COVERAGE_REPORT_NAME_UNIT)
# -count=1 is included to invalidate the test cache. This way, if you run "make test-go" multiple times
# you will get fresh test results each time. For instance, changing the source of mocked packages
# does not invalidate the cache so having the -count=1 to invalidate the test cache is useful.
go test -v -count 1 -coverprofile=$(CODE_COVERAGE_REPORT_NAME_UNIT).out ./...

test-go-ci:
test-go-ci: $(CODE_COVERAGE_REPORT_NAME_UNIT)
mkdir -p $(PWD)/build/test-results
mkdir -p $(PWD)/build/test-coverage
$(MAKE) test-go | go run github.com/tebeka/go2xunit > "$(PWD)/build/test-results/TEST-unit.xml"
Expand Down