-
Notifications
You must be signed in to change notification settings - Fork 0
/
justfile
41 lines (31 loc) · 1.26 KB
/
justfile
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
test_unit:
cargo build --workspace --tests
cargo test --no-fail-fast --workspace --exclude lard_tests -- --nocapture
test_all: setup && clean
cargo test --workspace --no-fail-fast -- --nocapture --test-threads=1
test_end_to_end: setup && clean
-cargo test --test end_to_end --no-fail-fast -- --nocapture --test-threads=1
test_migrations: debug_migrations && clean
# Debug commands don't perfom the clean up action after running.
# This allows to manually check the state of the database.
debug_kafka: setup
-cargo test --test end_to_end test_kafka --features debug --no-fail-fast -- --nocapture --test-threads=1
debug_test TEST: setup
-cargo test {{TEST}} --features debug --no-fail-fast -- --nocapture --test-threads=1
debug_migrations: setup
-@ cd migrations && go test -v ./...
# psql into the container database
psql:
@docker exec -it lard_tests psql -U postgres
setup:
@ echo "Starting Postgres docker container..."
docker run --name lard_tests -e POSTGRES_PASSWORD=postgres -p 5432:5432 -d postgres
@ echo; sleep 5
cargo build --workspace --tests
@ echo; echo "Loading DB schema..."; echo
@target/debug/prepare_postgres
clean:
@ echo "Stopping Postgres container..."
docker stop lard_tests
@ echo "Removing Postgres container..."
docker rm lard_tests