blob: 665c2143e659c36fed25ad9211a8993a6bcf4f56 (
plain)
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
|
#!/usr/bin/make
# Makefile readme (ru): <http://linux.yaroslavl.ru/docs/prog/gnu_make_3-79_russian_manual.html>
# Makefile readme (en): <https://www.gnu.org/software/make/manual/html_node/index.html#SEC_Contents>
SHELL = /bin/sh
.DEFAULT_GOAL := build
# This will output the help for each task. thanks to https://marmelab.com/blog/2016/02/29/auto-documented-makefile.html
help: ## Show this help
@printf "\033[33m%s:\033[0m\n" 'Available commands'
@awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z0-9_-]+:.*?## / {printf " \033[32m%-14s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST)
build: ## Build RR binary file for local os/arch
CGO_ENABLED=0 go build -trimpath -ldflags "-s" -o ./rr ./cmd/main.go
clean: ## Make some clean
rm ./rr
install: build ## Build and install RR locally
cp rr /usr/local/bin/rr
uninstall: ## Uninstall locally installed RR
rm -f /usr/local/bin/rr
test: ## Run application tests
go clean -testcache
docker-compose -f tests/docker-compose.yaml up -d
go test -v -race -cover -tags=debug -covermode=atomic ./utils
go test -v -race -cover -tags=debug -covermode=atomic ./pkg/pipe
go test -v -race -cover -tags=debug -covermode=atomic ./pkg/pool
go test -v -race -cover -tags=debug -covermode=atomic ./pkg/socket
go test -v -race -cover -tags=debug -covermode=atomic ./pkg/worker
go test -v -race -cover -tags=debug -covermode=atomic ./tests/plugins/http
go test -v -race -cover -tags=debug -covermode=atomic ./tests/plugins/informer
go test -v -race -cover -tags=debug -covermode=atomic ./tests/plugins/reload
go test -v -race -cover -tags=debug -covermode=atomic ./tests/plugins/server
go test -v -race -cover -tags=debug -covermode=atomic ./tests/plugins/checker
go test -v -race -cover -tags=debug -covermode=atomic ./tests/plugins/config
go test -v -race -cover -tags=debug -covermode=atomic ./tests/plugins/gzip
go test -v -race -cover -tags=debug -covermode=atomic ./tests/plugins/headers
go test -v -race -cover -tags=debug -covermode=atomic ./tests/plugins/logger
go test -v -race -cover -tags=debug -covermode=atomic ./tests/plugins/metrics
go test -v -race -cover -tags=debug -covermode=atomic ./tests/plugins/redis
go test -v -race -cover -tags=debug -covermode=atomic ./tests/plugins/resetter
go test -v -race -cover -tags=debug -covermode=atomic ./tests/plugins/rpc
go test -v -race -cover -tags=debug -covermode=atomic ./tests/plugins/static
go test -v -race -cover -tags=debug -covermode=atomic ./plugins/kv/boltdb
go test -v -race -cover -tags=debug -covermode=atomic ./plugins/kv/memory
go test -v -race -cover -tags=debug -covermode=atomic ./plugins/kv/memcached
go test -v -race -cover -tags=debug -covermode=atomic ./tests/plugins/kv/boltdb
go test -v -race -cover -tags=debug -covermode=atomic ./tests/plugins/kv/memory
go test -v -race -cover -tags=debug -covermode=atomic ./tests/plugins/kv/memcached
docker-compose -f tests/docker-compose.yaml down
lint: ## Run application linters
golangci-lint run
kv:
docker-compose -f tests/docker-compose.yaml up -d
go test -v -race -cover -tags=debug -covermode=atomic ./plugins/kv/boltdb
go test -v -race -cover -tags=debug -covermode=atomic ./plugins/kv/memory
go test -v -race -cover -tags=debug -covermode=atomic ./plugins/kv/memcached
go test -v -race -cover -tags=debug -covermode=atomic ./tests/plugins/kv/boltdb
go test -v -race -cover -tags=debug -covermode=atomic ./tests/plugins/kv/memory
go test -v -race -cover -tags=debug -covermode=atomic ./tests/plugins/kv/memcached
docker-compose -f tests/docker-compose.yaml down
|