-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
35 lines (31 loc) · 818 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
GO ?= go
TESTFOLDER := $(shell $(GO) list ./...)
TESTTAGS ?= "integration"
.PHONY: test
test:
$(GO) test ./... -race
test-integration:
docker-compose build && docker-compose run web $(GO) test ./... -race -tags $(TESTTAGS) -cover
test-ci:
echo "mode: count" > coverage.out
for d in $(TESTFOLDER); do \
$(GO) test -tags $(TESTTAGS) -v -covermode=count -coverprofile=profile.out $$d > tmp.out; \
cat tmp.out; \
if grep -q "^--- FAIL" tmp.out; then \
rm tmp.out; \
exit 1; \
elif grep -q "build failed" tmp.out; then \
rm tmp.out; \
exit 1; \
elif grep -q "setup failed" tmp.out; then \
rm tmp.out; \
exit 1; \
fi; \
if [ -f profile.out ]; then \
cat profile.out | grep -v "mode:" >> coverage.out; \
rm profile.out; \
fi; \
done
.PHONY: vet
vet:
$(GO) vet $(VETPACKAGES)