-
-
Notifications
You must be signed in to change notification settings - Fork 221
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Consolidate DB init and tests, add justfile
* Add justfile to simplify running all the tests * Save all PBF outputs to the text files * Consolidate all tests to reuse the same code * Consolidate database initialization * updated readme with the new instructions
- Loading branch information
Showing
66 changed files
with
314,449 additions
and
143 deletions.
There are no files selected for viewing
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 |
---|---|---|
|
@@ -11,3 +11,4 @@ Dockerfile | |
|
||
pg_data/ | ||
config.yml | ||
tests/output/ |
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
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 |
---|---|---|
|
@@ -7,3 +7,4 @@ | |
|
||
pg_data/ | ||
config.yml | ||
tests/output/ |
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,54 @@ | ||
#!/usr/bin/env just --justfile | ||
set shell := ["bash", "-c"] | ||
|
||
export DATABASE_URL := "postgres://postgres@localhost/db" | ||
export CARGO_TERM_COLOR := "always" | ||
# export RUST_BACKTRACE := "1" | ||
|
||
@_default: | ||
just --list | ||
|
||
# Start Martin server and a test database | ||
run: start-db | ||
cargo run | ||
|
||
# Perform cargo clean to delete all build files | ||
clean: clean-test | ||
cargo clean | ||
|
||
# Delete test output files | ||
clean-test: | ||
rm -rf tests/output | ||
|
||
# Start a test database | ||
start-db: | ||
docker-compose up -d db | ||
|
||
alias _down := stop | ||
alias _stop-db := stop | ||
|
||
# Stop the test database | ||
stop: | ||
docker-compose down | ||
|
||
# Run benchmark tests | ||
bench: start-db | ||
cargo bench | ||
|
||
# Run all tests using a test database | ||
test: start-db test-unit test-int | ||
|
||
# Run Rust unit tests (cargo test) | ||
test-unit: start-db | ||
cargo test | ||
|
||
# Run integration tests | ||
test-int: start-db clean-test | ||
tests/test.sh | ||
diff --brief --recursive --new-file tests/output tests/expected | ||
|
||
# Run integration tests and save its output as the new expected output | ||
test-bless: start-db clean-test | ||
tests/test.sh | ||
rm -rf tests/expected | ||
mv tests/output tests/expected |
Oops, something went wrong.