-
Notifications
You must be signed in to change notification settings - Fork 31
/
Makefile
83 lines (67 loc) · 2.28 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
79
80
81
82
83
GOPATH ?= $(shell go env GOPATH)
BUILD_DIR ?= $(CURDIR)/build
.DEFAULT_GOAL := build
BUILD_FLAGS ?= -mod=readonly
build: build-tm-load-test build-tm-outage-sim-server
.PHONY: build
build-tm-load-test:
@go build $(BUILD_FLAGS) \
-ldflags "-X github.com/informalsystems/tm-load-test/pkg/loadtest.cliVersionCommitID=`git rev-parse --short HEAD`" \
-o $(BUILD_DIR)/tm-load-test ./cmd/tm-load-test/main.go
.PHONY: build-tm-load-test
build-tm-outage-sim-server:
@go build $(BUILD_FLAGS) -o $(BUILD_DIR)/tm-outage-sim-server ./cmd/tm-outage-sim-server/main.go
.PHONY: built-tm-outage-sim-server
build-linux: build-tm-load-test-linux build-tm-outage-sim-server-linux
.PHONY: build-linux
build-tm-load-test-linux:
GOOS=linux GOARCH=amd64 $(MAKE) build-tm-load-test
.PHONY: build-tm-load-test-linux
build-tm-outage-sim-server-linux:
GOOS=linux GOARCH=amd64 $(MAKE) build-tm-outage-sim-server
.PHONY: build-tm-outage-sim-server-linux
test:
go test -cover -race ./...
.PHONY: test
# Builds a Docker image called "cometbft/localnode", which is based on
# Tendermint Core. Takes the current system user and group ID as the user/group
# IDs for the tmuser user within the container so as to eliminate permissions
# issues when generating testnet files in the localnet target.
localnode:
@docker build -f ./test/localnode/Dockerfile \
--build-arg UID=$(shell id -u) \
--build-arg GID=$(shell id -g) \
-t cometbft/localnode:latest \
./test/localnode/
.PHONY: localnode
localnet: localnode
@if ! [ -f build/node0/config/genesis.json ]; then \
mkdir -p build && \
docker run \
--rm \
-v $(BUILD_DIR):/cometbft:Z \
cometbft/localnode \
testnet --config /etc/cometbft/config-template.toml --o . --starting-ip-address 192.168.10.2; \
fi
.PHONY: localnet
localnet-start: localnet
@docker compose -f ./test/docker-compose.yml up -d
.PHONY: localnet-start
localnet-stop:
@docker compose -f ./test/docker-compose.yml down
.PHONY: localnet-stop
integration-test:
@./test/integration-test.sh
.PHONY: integration-test
bench:
go test -bench="Benchmark" -run="notests" ./...
.PHONY: bench
lint:
go run github.com/golangci/golangci-lint/cmd/golangci-lint@latest run
.PHONY: lint
clean:
rm -rf $(BUILD_DIR)
.PHONY: clean
vulncheck:
@go run golang.org/x/vuln/cmd/govulncheck@latest ./...
.PHONY: vulncheck