-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
54 lines (44 loc) · 1.37 KB
/
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# SDK additional packages that are used for development of the SDK.
SDK_CORE_PKGS=./pangea/... ./internal/...
SDK_CLIENT_PKGS=./service/...
SDK_ALL_PKGS= ${SDK_CLIENT_PKGS} ${SDK_CORE_PKGS}
TEST_TIMEOUT=-timeout 5m
###################
# Unit Testing #
###################
unit:
@echo "Started unit tests"
go test ${TEST_TIMEOUT} -tags=unit -v -count=1 -race ${SDK_ALL_PKGS}
@echo "Finished unit tests"
#######################
# Integration Testing #
#######################
integration:
@echo "Started integration tests"
go test -count=1 -tags integration -v ./service/...
@echo "Finished integration tests"
coverage.out: $(shell find . -type f -print | grep -v vendor | grep "\.go")
@go test -cover -coverprofile ./coverage.out.tmp ${SDK_ALL_PKGS}
@cat ./coverage.out.tmp | grep -v '.pb.go' | grep -v 'mock_' > ./coverage.out
@rm ./coverage.out.tmp
cover: coverage.out
@echo ""
@go tool cover -func ./coverage.out ${SDK_ALL_PKGS}
cover-html: coverage.out
@go tool cover -html=./coverage.out ${SDK_ALL_PKGS}
clean:
@rm ./coverage.out
##################
# Linting/Verify #
##################
verify: vet
vet:
go vet -tags "example integration" --all ${SDK_ALL_PKGS}
fmt:
@gofmt -l -w .
##########################
# Generate Documentation #
##########################
docgen:
@echo "Generating docs JSON from docstrings"
@go run ./autogendoc/main.go > ./go_sdk.json || exit 1