-
Notifications
You must be signed in to change notification settings - Fork 13
/
Makefile
65 lines (53 loc) · 1.56 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
ifeq "${count}" ""
count=1
endif
ifeq "${run}" ""
run=""
endif
ifeq "${bench}" ""
bench=.
endif
# `make test count=50` to run `go test -race -count=50 ./...`
# `make test run=TestXXX` to run `go test -race -run=TestXXX ./...`
.PHONY: test
test:
go test -race -run=${run} -count=${count} ./...
.PHONY: nats-test
nats-test:
docker-compose -f .docker/nats-test.yml up --build --abort-on-container-exit --remove-orphans; \
docker-compose -f .docker/nats-test.yml down
.PHONY: nats-bench
nats-bench:
docker-compose -f .docker/nats-bench.yml up --build --abort-on-container-exit --remove-orphans; \
docker-compose -f .docker/nats-bench.yml down
.PHONY: mongo-test
mongo-test:
docker-compose -f .docker/mongo-test.yml up --build --abort-on-container-exit --remove-orphans; \
docker-compose -f .docker/mongo-test.yml down
.PHONY: coverage
coverage:
docker-compose \
-f .docker/mongo-test.yml \
-f .docker/nats-test.yml \
-f .docker/coverage.yml up \
--build --abort-on-container-exit --remove-orphans; \
docker-compose -f .docker/coverage.yml down; \
go tool cover -html=out/coverage.out
.PHONY: github-coverage
github-coverage:
docker-compose \
-f .docker/mongo-test.yml \
-f .docker/nats-test.yml \
-f .docker/coverage.yml up \
--build --abort-on-container-exit --remove-orphans; \
docker-compose -f .docker/coverage.yml down; \
.PHONY: bench
bench:
go test -bench=${bench} -run=${run} -count=${count} ./...
.PHONY: cli
cli:
go install ./cmd/goes
.PHONY: mock-cli-connector
mock-cli-connector:
go run ./internal/cmd/cli-connector/main.go
.PHONY: cli-connector