-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile
44 lines (33 loc) · 1.08 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
.PHONY: generate test add gadd tic tac a b c d
add:
curl -X POST localhost:8180/sum -d '{"a": 1, "b":1}'
gadd:
grpcurl -plaintext -proto ./pb/add/add.proto -d '{"a": 1, "b":1}' localhost:8181 pb.Add.Sum
tic:
curl -X POST localhost:9190/tic
tac:
curl localhost:9190/tac
a:
curl -X POST localhost:80/api/v1/add/sum -d '{"a": 1, "b":1}'
b:
grpcurl -plaintext -proto ./pb/add/add.proto -d '{"a": 1, "b":1}' localhost:443 pb.Add.Sum
c:
curl -X POST localhost:80/api/v1/tictac/tic
d:
curl localhost:80/api/v1/tictac/tac
# Regenerates OPA data from rego files
HAVE_GO_BINDATA := $(shell command -v mockgen 2> /dev/null)
generate:
ifndef HAVE_GO_BINDATA
@echo "requires 'mockgen' (GO111MODULE=on go get github.com/golang/mock/mockgen@v1.4.4)"
@exit 1 # fail
else
go generate ./...
endif
## test: run unit test
test:
# DEBUG=true bash -c "go test -v github.com/qeek-dev/retailbase/<package-name> -run ..."
go test -v -race -cover -coverprofile unit_cover.out ./...
## integration: run integration test
integration:
go test -v -race -tags=integration -coverprofile integration_cover.out ./...