Repository navigation
Expand file tree
/
Copy pathMakefile
More file actions
50 lines (36 loc) · 1.58 KB
/
Copy pathMakefile
File metadata and controls
50 lines (36 loc) · 1.58 KB
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
# Developer entry points. Requires Docker and the Rust stable toolchain.
SOURCE_URL ?= postgres://pgsync:pgsync@localhost:5433/app
TARGET_URL ?= postgres://postgres:postgres@localhost:5434/app
E2E_DIR ?= target/e2e
.PHONY: build test lint fmt up down e2e e2e-slow live check bootstrap run status cleanup bench publish
build:
cargo build --release
test:
cargo test --workspace
lint:
cargo fmt --all -- --check
cargo clippy --workspace --all-targets -- -D warnings
fmt:
cargo fmt --all
up:
docker compose up -d --wait
down:
docker compose down -v
## Live protocol test + fast end-to-end scenarios (about 6 minutes).
e2e: up
PGSYNC_TEST_SOURCE_URL=$(SOURCE_URL) cargo test -p pgsync-postgres --test live_replication
PGSYNC_E2E=1 PGSYNC_E2E_DIR=$(E2E_DIR) cargo test -p pgsync --test e2e -- --test-threads=1
## Disruptive scenarios: container pause/restart, random crash loop, large table.
e2e-slow: up
PGSYNC_E2E=1 PGSYNC_E2E_DIR=$(E2E_DIR) cargo test -p pgsync --test e2e -- --test-threads=1 --ignored
check bootstrap run status:
PGSYNC_SOURCE_URL=$(SOURCE_URL) PGSYNC_TARGET_URL=$(TARGET_URL) cargo run -q --release -- --config examples/pgsync.yaml $@
cleanup:
PGSYNC_SOURCE_URL=$(SOURCE_URL) PGSYNC_TARGET_URL=$(TARGET_URL) cargo run -q --release -- --config examples/pgsync.yaml cleanup --yes
bench: build
SOURCE_URL=$(SOURCE_URL) TARGET_URL=$(TARGET_URL) ./scripts/bench.sh
## Publish the three crates to crates.io in dependency order (needs `cargo login`).
publish:
cargo publish --locked -p pgsync-core
cargo publish --locked -p pgsync-postgres
cargo publish --locked -p pgsync