-
Notifications
You must be signed in to change notification settings - Fork 196
/
Makefile
78 lines (60 loc) · 1.87 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
74
75
76
77
78
default: test
.PHONY: lint
lint:
docker run --rm -v $$(pwd):/app -w /app golangci/golangci-lint:v1.42.1 golangci-lint run -v --timeout 2m
.PHONY: test
test:
go test -race -short ./...
.PHONY: test_cover
test_cover:
go list -f '{{if len .TestGoFiles}}"cd {{.Dir}} && go test -race -short -coverprofile={{.Dir}}/.coverprofile {{.ImportPath}}"{{end}}' ./... | xargs -L 1 sh -c
go run ./hack/coverage/coverage.go . unit.coverprofile
@find . -name \.coverprofile -type f -delete
.PHONY: test_integration
test_integration:
go test -race -run Integration ./...
.PHONY: test_integration_cover
test_integration_cover:
go list -f '{{if len .TestGoFiles}}"cd {{.Dir}} && go test -race -run Integration -coverprofile={{.Dir}}/.coverprofile {{.ImportPath}}"{{end}}' ./... | xargs -L 1 sh -c
go run ./hack/coverage/coverage.go . integration.coverprofile
@find . -name \.coverprofile -type f -delete
.PHONY: test_loadtest
test_loadtest:
go test -race -run Loadtest ./...
.PHONY: test_all_docker
test_all_docker:
docker-compose up --build --force-recreate eventhorizon-test
.PHONY: merge_coverage
merge_coverage:
go run ./hack/coverage/coverage.go .
.PHONY: upload_coverage
upload_coverage:
go run github.com/mattn/goveralls -coverprofile=coverage.out -repotoken="$$COVERALLS_TOKEN"
.PHONY: run
run:
docker-compose up -d mongodb gpubsub kafka redis nats
.PHONY: run_mongodb
run_mongodb:
docker-compose up -d mongodb
.PHONY: run_gpubsub
run_gpubsub:
docker-compose up -d gpubsub
.PHONY: run_kafka
run_kafka:
docker-compose up -d kafka
.PHONY: run_redis
run_redis:
docker-compose up -d redis
.PHONY: run_nats
run_nats:
docker-compose up -d nats
.PHONY: stop
stop:
docker-compose down
.PHONY: clean
clean:
@find . -name \.coverprofile -type f -delete
@rm -f coverage.out
.PHONY: mongodb_shell
mongodb_shell:
docker run -it --network eventhorizon_default --rm mongo:4.4 mongo --host mongodb test