mirror of
https://github.com/maplibre/martin.git
synced 2024-12-18 20:31:54 +03:00
Update minimal legacy db (#500)
* bump docker compose to use latest supported db and postgis * update justfile to allow simple legacy testing * update readme Followup: implement CI testing -- see #502
This commit is contained in:
parent
3c3f4ecd51
commit
cfc31fae1b
34
README.md
34
README.md
@ -593,7 +593,7 @@ services:
|
||||
- db
|
||||
|
||||
db:
|
||||
image: postgis/postgis:14-3.1-alpine
|
||||
image: postgis/postgis:14-3.3-alpine
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
- POSTGRES_DB=db
|
||||
@ -645,7 +645,7 @@ services:
|
||||
- db
|
||||
|
||||
db:
|
||||
image: postgis/postgis:14-3.1-alpine
|
||||
image: postgis/postgis:14-3.3-alpine
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
- POSTGRES_DB=db
|
||||
@ -758,17 +758,25 @@ martin postgres://postgres@localhost/db
|
||||
❯ cd martin
|
||||
❯ just
|
||||
Available recipes:
|
||||
run # Start Martin server and a test database
|
||||
clean # Perform cargo clean to delete all build files
|
||||
clean-test # Delete test output files
|
||||
start-db # Start a test database
|
||||
stop # Stop the test database
|
||||
bench # Run benchmark tests
|
||||
test # Run all tests using a test database
|
||||
test-unit # Run Rust unit tests (cargo test)
|
||||
test-int # Run integration tests
|
||||
bless # Run integration tests and save its output as the new expected output
|
||||
git *ARGS # Do any git command, ensuring that the testing environment is set up. Accepts the same arguments as git.
|
||||
Available recipes:
|
||||
run *ARGS # Start Martin server and a test database
|
||||
psql *ARGS # Run PSQL utility against the test database
|
||||
clean # Perform cargo clean to delete all build files
|
||||
clean-test # Delete test output files
|
||||
start-db # Start a test database
|
||||
start-legacy # Start a legacy test database
|
||||
docker-up name # Start a specific test database, e.g. db or db-legacy
|
||||
stop # Stop the test database
|
||||
bench # Run benchmark tests
|
||||
test # Run all tests using a test database
|
||||
test-unit # Run Rust unit and doc tests (cargo test)
|
||||
test-int # Run integration tests
|
||||
test-int-legacy # Run integration tests using legacy database
|
||||
test-integration name # Run integration tests with the given docker compose target
|
||||
bless # Run integration tests and save its output as the new expected output
|
||||
docker-build # Build martin docker image
|
||||
docker-run *ARGS # Build and run martin docker image
|
||||
git *ARGS # Do any git command, ensuring that the testing environment is set up. Accepts the same arguments as git.
|
||||
```
|
||||
|
||||
### Other useful commands
|
||||
|
@ -30,7 +30,7 @@ services:
|
||||
- ./tests/fixtures/initdb-dc.sh:/docker-entrypoint-initdb.d/20_martin.sh
|
||||
|
||||
db-legacy:
|
||||
image: postgis/postgis:9.6-2.5-alpine
|
||||
image: postgis/postgis:11-3.0-alpine
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
- "5432:5432"
|
||||
|
30
justfile
30
justfile
@ -25,8 +25,14 @@ clean-test:
|
||||
rm -rf tests/output
|
||||
|
||||
# Start a test database
|
||||
start-db:
|
||||
docker-compose up -d db
|
||||
start-db: (docker-up "db")
|
||||
|
||||
# Start a legacy test database
|
||||
start-legacy: (docker-up "db-legacy")
|
||||
|
||||
# Start a specific test database, e.g. db or db-legacy
|
||||
@docker-up name:
|
||||
docker-compose up -d {{name}}
|
||||
|
||||
alias _down := stop
|
||||
alias _stop-db := stop
|
||||
@ -49,15 +55,21 @@ test-unit: start-db
|
||||
cargo test --doc
|
||||
|
||||
# Run integration tests
|
||||
test-int: start-db clean-test
|
||||
test-int: (test-integration "db")
|
||||
|
||||
# Run integration tests using legacy database
|
||||
test-int-legacy: (test-integration "db-legacy")
|
||||
|
||||
# Run integration tests with the given docker compose target
|
||||
@test-integration name: (docker-up name) clean-test
|
||||
#!/usr/bin/env sh
|
||||
tests/test.sh
|
||||
# echo "** Skipping comparison with the expected values - not yet stable"
|
||||
# if ( ! diff --brief --recursive --new-file tests/output tests/expected ); then
|
||||
# echo "** Expected output does not match actual output"
|
||||
# echo "** If this is expected, run 'just bless' to update expected output"
|
||||
# echo "** Note that this error is not fatal because we don't have a stable output yet"
|
||||
# fi
|
||||
# echo "** Skipping comparison with the expected values - not yet stable"
|
||||
# if ( ! diff --brief --recursive --new-file tests/output tests/expected ); then
|
||||
# echo "** Expected output does not match actual output"
|
||||
# echo "** If this is expected, run 'just bless' to update expected output"
|
||||
# echo "** Note that this error is not fatal because we don't have a stable output yet"
|
||||
# fi
|
||||
|
||||
# Run integration tests and save its output as the new expected output
|
||||
bless: start-db clean-test
|
||||
|
Loading…
Reference in New Issue
Block a user