-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
65 lines (52 loc) · 1.72 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
POSTGRES_CONTAINER_NAME=pgboss
POSTGRES_HOST=127.0.0.1
POSTGRES_PORT=5444
POSTGRES_USER=username
POSTGRES_PASSWORD=password
POSTGRES_DATABASE=pgboss
.PHONY: precommit
precommit: fmt check test/doc test/e2e
.PHONY: fmt
fmt:
cargo fmt
.PHONY: check
check:
cargo fmt --check
cargo clippy --all-features
cargo d --no-deps --all-features
# https://users.rust-lang.org/t/how-to-document-optional-features-in-api-docs/64577/3
.PHONY: doc
doc:
RUSTDOCFLAGS='--cfg docsrs' cargo +nightly d --all-features --open
.PHONY: postgres
postgres:
docker compose -f docker/compose.yaml up -d --build
docker ps
sleep 10
docker compose -f docker/compose.yaml logs postgres --tail 10
.PHONY: postgres/start
postgres/start:
docker start ${POSTGRES_CONTAINER_NAME}
.PHONY: postgres/psql
postgres/psql:
docker exec -it pgboss sh -c "psql -U username pgboss"
.PHONY: postgres/kill
postgres/kill:
docker compose -f docker/compose.yaml down -v
.PHONY: test/doc
test/doc:
cargo test --locked --all-features --doc
.PHONY: test
test: test/e2e
.PHONY: test/e2e
test/e2e:
POSTGRES_URL=postgres://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${POSTGRES_HOST}:${POSTGRES_PORT}/${POSTGRES_DATABASE} \
cargo test --locked --all-features --all-targets --test e2e -- --nocapture --include-ignored $(pattern)
.PHONY: test/cov
test/cov:
POSTGRES_URL=postgres://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${POSTGRES_HOST}:${POSTGRES_PORT}/${POSTGRES_DATABASE} \
cargo llvm-cov --locked --all-features --lcov --test e2e --output-path lcov.info -- --include-ignored
.PHONY: test/load
test/load:
POSTGRES_URL=postgres://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${POSTGRES_HOST}:${POSTGRES_PORT}/${POSTGRES_DATABASE} \
cargo run --release --features binaries --bin loadtest -- $(args)