-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathMakefile
89 lines (71 loc) · 2.02 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
84
85
86
87
88
89
RM = rm -f
targets=bucky bucky-fill bucky-isempty bucky-pickle-relay bucky-sparsify buckyd findhash gentestmetrics
SHELL := /bin/bash
OS := $(shell uname)
PHONY: all
all: $(targets)
bucky:
go build -mod vendor ./cmd/$@
bucky-fill:
go build -mod vendor ./cmd/$@
bucky-isempty:
go build -mod vendor ./cmd/$@
bucky-pickle-relay:
go build -mod vendor ./cmd/$@
bucky-sparsify:
go build -mod vendor ./cmd/$@
buckyd:
go build -mod vendor ./cmd/$@
findhash:
go build -mod vendor ./cmd/$@
gentestmetrics:
go build -mod vendor ./cmd/$@
test:
pushd ./testing/data && python3 gentests.py && popd
go test ./...
# To keep testdata after running test for debugging, run the following command:
#
# make e2e_test REBALANCE_FLAGS=-keep-testdata
#
# Run test_setup_$os first
e2e_test: clean bucky buckyd
go run -mod vendor testing/copy/main.go $(COPY_FLAGS)
go run -mod vendor testing/rebalance/main.go $(REBALANCE_FLAGS)
go run -mod vendor testing/backfill2/main.go $(BACKFILL_FLAGS)
e2e_test_rebalance_health_check: clean bucky buckyd
go run -mod vendor testing/rebalance_health_check/main.go $(REBALANCE_FLAGS)
e2e_test_setup:
ifeq ($(OS),Linux)
sudo ip addr add 127.0.1.7 dev lo
sudo ip addr add 127.0.1.8 dev lo
sudo ip addr add 127.0.1.9 dev lo
endif
ifeq ($(OS),Darwin)
sudo ifconfig lo0 alias 127.0.1.7 up
sudo ifconfig lo0 alias 127.0.1.8 up
sudo ifconfig lo0 alias 127.0.1.9 up
endif
e2e_test_setup_clean:
ifeq ($(OS),Linux)
sudo ip addr del 127.0.1.7/32 dev lo
sudo ip addr del 127.0.1.8/32 dev lo
sudo ip addr del 127.0.1.9/32 dev lo
endif
ifeq ($(OS),Darwin)
sudo ifconfig lo0 -alias 127.0.1.7
sudo ifconfig lo0 -alias 127.0.1.8
sudo ifconfig lo0 -alias 127.0.1.9
endif
clean_test:
rm -rf bucky buckyd
rm -rf testdata_rebalance_*
rm -rf testdata_copy_*
rm -rf testdata_backfill2_*
rm -rf testdata_rebalance_health_check_*
rm -rf testing/data/*.line
rm -rf testing/data/*.pickle
rm -rf fill/*.wsp
rm -rf cmd/bucky-sparsify/sourcefile
rm -rf cmd/bucky-sparsify/sourcefile.sparse
clean: clean_test
$(RM) $(targets)