mirror of https://github.com/status-im/migrate.git
Make coverage directory configurable
This commit is contained in:
parent
50d049d5f5
commit
53606261bf
13
Makefile
13
Makefile
|
@ -3,6 +3,7 @@ DATABASE ?= postgres mysql redshift cassandra sqlite3 spanner cockroachdb clickh
|
||||||
VERSION ?= $(shell git describe --tags 2>/dev/null | cut -c 2-)
|
VERSION ?= $(shell git describe --tags 2>/dev/null | cut -c 2-)
|
||||||
TEST_FLAGS ?=
|
TEST_FLAGS ?=
|
||||||
REPO_OWNER ?= $(shell cd .. && basename "$$(pwd)")
|
REPO_OWNER ?= $(shell cd .. && basename "$$(pwd)")
|
||||||
|
COVERAGE_DIR ?= .coverage
|
||||||
|
|
||||||
|
|
||||||
build-cli: clean
|
build-cli: clean
|
||||||
|
@ -24,11 +25,11 @@ test-short:
|
||||||
|
|
||||||
|
|
||||||
test:
|
test:
|
||||||
@-rm -r .coverage
|
@-rm -r $(COVERAGE_DIR)
|
||||||
@mkdir .coverage
|
@mkdir $(COVERAGE_DIR)
|
||||||
make test-with-flags TEST_FLAGS='-v -race -covermode atomic -coverprofile .coverage/_$$(RAND).txt -bench=. -benchmem -timeout 20m'
|
make test-with-flags TEST_FLAGS='-v -race -covermode atomic -coverprofile $$(COVERAGE_DIR)/_$$(RAND).txt -bench=. -benchmem -timeout 20m'
|
||||||
@echo 'mode: atomic' > .coverage/combined.txt
|
@echo 'mode: atomic' > $(COVERAGE_DIR)/combined.txt
|
||||||
@cat .coverage/_*.txt | grep -v 'mode: atomic' >> .coverage/combined.txt
|
@cat $(COVERAGE_DIR)/_*.txt | grep -v 'mode: atomic' >> $(COVERAGE_DIR)/combined.txt
|
||||||
|
|
||||||
|
|
||||||
test-with-flags:
|
test-with-flags:
|
||||||
|
@ -53,7 +54,7 @@ kill-orphaned-docker-containers:
|
||||||
|
|
||||||
|
|
||||||
html-coverage:
|
html-coverage:
|
||||||
go tool cover -html=.coverage/combined.txt
|
go tool cover -html=$(COVERAGE_DIR)/combined.txt
|
||||||
|
|
||||||
|
|
||||||
deps:
|
deps:
|
||||||
|
|
Loading…
Reference in New Issue