-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
43 additions
and
46 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
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 ./... | ||
|
||
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 |