diff options
Diffstat (limited to 'workhorse/Makefile')
-rw-r--r-- | workhorse/Makefile | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/workhorse/Makefile b/workhorse/Makefile index fe9bf639753..a0412f5e2e1 100644 --- a/workhorse/Makefile +++ b/workhorse/Makefile @@ -84,8 +84,8 @@ test: prepare-tests else \ $(MAKE) run-gitaly ; \ fi - @go test -tags "$(BUILD_TAGS)" ./... ;\ - status="$$?" ;\ + go test ${TEST_OPTIONS} -tags "$(BUILD_TAGS)" ./... + @status="$$?" ;\ if [ -f "$(GITALY_PID_FILE)" ] ; then \ echo "Clean up Gitaly server for workhorse integration test" ;\ kill -9 $$(cat $(GITALY_PID_FILE)) ;\ @@ -96,10 +96,21 @@ test: prepare-tests exit "$$status" @echo SUCCESS +.PHONY: test-race +test-race: TEST_OPTIONS = -race +test-race: test + +.PHONY: test-coverage +test-coverage: TEST_OPTIONS = -cover -coverprofile=cover.out +test-coverage: test + $(call message, "Calculating the coverage") + [ -f cover.out ] && go tool cover -html cover.out -o coverage.html + [ -f cover.out ] && go tool cover -func cover.out + .PHONY: clean clean: clean-workhorse clean-build $(call message,$@) - rm -rf testdata/data testdata/scratch + rm -rf testdata/data testdata/scratch cover.out coverage.html .PHONY: clean-workhorse clean-workhorse: @@ -112,8 +123,7 @@ clean-build: rm -rf $(TARGET_DIR) .PHONY: prepare-tests -prepare-tests: testdata/data/group/test.git $(EXE_ALL) -prepare-tests: testdata/scratch +prepare-tests: testdata/scratch $(EXE_ALL) .PHONY: run-gitaly run-gitaly: $(GITALY_PID_FILE) @@ -130,10 +140,6 @@ gitaly.toml: ../tmp/tests/gitaly/config.toml $(call message, "Building a complete test environment") cd .. ; ./scripts/setup-test-env -testdata/data/group/test.git: - $(call message,$@) - git clone --quiet --bare https://gitlab.com/gitlab-org/gitlab-test.git $@ - testdata/scratch: mkdir -p testdata/scratch |