Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify unit tests runner #4087

Merged
merged 4 commits into from
May 5, 2021
Merged
Show file tree
Hide file tree
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
13 changes: 10 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# WARNING: do not commit to a repository!
-include Makefile.local

.PHONY: all test clean images protos exes dist doc clean-doc check-doc
.PHONY: all test cover clean images protos exes dist doc clean-doc check-doc
.DEFAULT_GOAL := all

# Version number
Expand Down Expand Up @@ -115,7 +115,7 @@ GOVOLUMES= -v $(shell pwd)/.cache:/go/cache:delegated,z \
-v $(shell pwd)/.pkg:/go/pkg:delegated,z \
-v $(shell pwd):/go/src/github.com/cortexproject/cortex:delegated,z

exes $(EXES) protos $(PROTO_GOS) lint test shell mod-check check-protos web-build web-pre web-deploy doc: build-image/$(UPTODATE)
exes $(EXES) protos $(PROTO_GOS) lint test cover shell mod-check check-protos web-build web-pre web-deploy doc: build-image/$(UPTODATE)
@mkdir -p $(shell pwd)/.pkg
@mkdir -p $(shell pwd)/.cache
@echo
Expand Down Expand Up @@ -200,7 +200,14 @@ lint:
kubeval ./k8s/*

test:
./tools/test -netgo
go test -tags netgo -timeout 30m -race -count 1 ./...
pracucci marked this conversation as resolved.
Show resolved Hide resolved

cover:
$(eval COVERDIR := $(shell mktemp -d coverage.XXXXXXXXXX))
$(eval COVERFILE := $(shell mktemp $(COVERDIR)/unit.XXXXXXXXXX))
go test -tags netgo -timeout 30m -race -count 1 -coverprofile=$(COVERFILE) ./...
go tool cover -html=$(COVERFILE) -o cover.html
go tool cover -func=cover.html | tail -n1

shell:
bash
Expand Down
131 changes: 0 additions & 131 deletions tools/test

This file was deleted.