-
Notifications
You must be signed in to change notification settings - Fork 21
/
Makefile
73 lines (58 loc) · 2.14 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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
# Copyright © 2018 by PACE Telematics GmbH. All rights reserved.
JSONAPITEST=http/jsonapi/generator/internal
JSONAPIGEN="./tools/jsonapigen/main.go"
GOPATH?=~/go
GO:=go
GO_TEST_FLAGS:=-count=1 -v -cover -race
export JAEGER_SERVICE_NAME:=unittest
export LOG_FORMAT:=console
.PHONY: install
install:
$(GO) install ./cmd/pb
.PHONY: vuln-scan
vuln-scan:
(cd /; $(GO) install -v -x golang.org/x/vuln/cmd/govulncheck@latest)
govulncheck ./...
.PHONY: jsonapi
jsonapi:
$(GO) run $(JSONAPIGEN) -pkg poi \
-path $(JSONAPITEST)/poi/open-api_test.go \
-source $(JSONAPITEST)/poi/open-api.json
$(GO) run $(JSONAPIGEN) --pkg fueling \
-path $(JSONAPITEST)/fueling/open-api_test.go \
-source $(JSONAPITEST)/fueling/open-api.json
$(GO) run $(JSONAPIGEN) -pkg pay \
-path $(JSONAPITEST)/pay/open-api_test.go \
-source $(JSONAPITEST)/pay/open-api.json
$(GO) run $(JSONAPIGEN) -pkg articles \
-path $(JSONAPITEST)/articles/open-api_test.go \
-source $(JSONAPITEST)/articles/open-api.json
$(GO) run $(JSONAPIGEN) -pkg securitytest \
-path $(JSONAPITEST)/securitytest/open-api_test.go \
-source $(JSONAPITEST)/securitytest/open-api.json
$(GO) run $(JSONAPIGEN) -pkg simple \
-path tools/testserver/simple/open-api.go \
-source tools/testserver/simple/open-api.json
.PHONY: grpc
grpc: tools/testserver/math/math.pb.go
tools/testserver/math/math.pb.go: tools/testserver/math/math.proto
(cd /; $(GO) install -v -x google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest)
(cd /; $(GO) install -v -x google.golang.org/protobuf/cmd/protoc-gen-go@latest)
protoc -I=./ --go-grpc_out=$(dir @) --go_out=$(dir @) $<
.PHONY: lint
lint:
(cd /; $(GO) install -v -x github.com/golangci/golangci-lint/cmd/golangci-lint@latest)
golangci-lint run --timeout 2m
.PHONY: test
test:
$(GO) test $(GO_TEST_FLAGS) -covermode=atomic -coverprofile=coverage.out -short ./...
.PHONY: integration
integration:
$(GO) test $(GO_TEST_FLAGS) -run TestIntegration ./...
$(GO) test $(GO_TEST_FLAGS) -run Example_clusterBackgroundTask ./pkg/routine
.PHONY: testserver
testserver:
docker-compose up
.PHONY: ci
ci:
$(GO) test $(GO_TEST_FLAGS) -covermode=atomic -coverprofile=coverage.out ./...