-
Notifications
You must be signed in to change notification settings - Fork 5
/
Makefile
39 lines (29 loc) · 958 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
TESTABLE_PACKAGES = `go list ./... | grep -v examples | grep -v constants | grep -v testing | grep -v cmd | grep -v protos`
setup:
@dep ensure
run:
@go run main.go start
run-grpc:
@go run main.go start -g true -r 3939
ensure-test-bin:
@[ -f testing/server ] || go build -o testing/server examples/main.go
test-dep: ensure-test-bin
@cd testing/ && docker-compose up -d
@testing/server 2>/dev/null & echo $$! > testserver.pid
go-test:
@echo "=========RUNNING UNIT TESTS==========="
@sleep 2
@-go test $(TESTABLE_PACKAGES) -coverprofile coverprofile.out -failfast -count=1
.SILENT:
kill-test-server:
if [ -e testserver.pid ]; then \
kill -TERM $$(cat testserver.pid) || true; \
rm testserver.pid || true; \
fi;
kill-testing-deps:
@cd testing/ && docker-compose down; true
setup-ci:
@go get -u github.com/golang/dep/cmd/dep
@go get -u github.com/wadey/gocovmerge
@dep ensure
test: kill-testing-deps test-dep go-test kill-test-server