forked from jonhoo/faktory-rs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
75 lines (60 loc) · 1.65 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
FAKTORY_IP=127.0.0.1
FAKTORY_HOST=localhost
FAKTORY_PORT=7419
FAKTORY_PORT_SECURE=17419
FAKTORY_PORT_UI=7420
FAKTORY_PASSWORD=uredinales
.PHONY: precommit
precommit: fmt check test/doc test/e2e test/e2e/tls
.PHONY: fmt
fmt:
cargo fmt
.PHONY: check
check:
cargo fmt --check
cargo clippy --all-features
cargo d --no-deps --all-features
.PHONY: doc
doc:
RUSTDOCFLAGS='--cfg docsrs' cargo +nightly d --all-features --open
.PHONY: faktory
faktory:
docker run --rm -d \
-v faktory-data:/var/lib/faktory \
-p ${FAKTORY_IP}:${FAKTORY_PORT}:7419 \
-p ${FAKTORY_IP}:${FAKTORY_PORT_UI}:7420 \
--name faktory \
contribsys/faktory:1.9.1 \
/faktory -b :7419 -w :7420
.PHONY: faktory/kill
faktory/kill:
docker stop faktory
.PHONY: faktory/tls
faktory/tls:
docker compose -f docker/compose.yml up -d --build
.PHONY: faktory/tls/kill
faktory/tls/kill:
docker compose -f docker/compose.yml down -v
.PHONY: test
test:
cargo t --locked --all-features --all-targets
.PHONY: test/doc
test/doc:
cargo test --locked --all-features --doc
.PHONY: test/e2e
test/e2e:
FAKTORY_URL=tcp://${FAKTORY_HOST}:${FAKTORY_PORT} cargo test --locked --all-features --all-targets
.PHONY: test/e2e/tls
test/e2e/tls:
FAKTORY_URL_SECURE=tcp://:${FAKTORY_PASSWORD}@${FAKTORY_HOST}:${FAKTORY_PORT_SECURE} \
FAKTORY_URL=tcp://:${FAKTORY_PASSWORD}@${FAKTORY_HOST}:${FAKTORY_PORT} \
cargo test --locked --features native_tls,rustls --test tls -- --nocapture
.PHONY: test/load
test/load:
cargo run --release --features binaries
.PHONY: test/perf
test/perf:
CARGO_PROFILE_RELEASE_DEBUG=true cargo flamegraph -o perf.flamegraph.svg -f binaries -b loadtest
.PHONY: test/perf/clean
test/perf/clean:
rm perf.*