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:
Yuri Astrakhan 2022-12-04 00:34:44 -05:00 committed by GitHub
parent 3c3f4ecd51
commit cfc31fae1b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 43 additions and 23 deletions

View File

@ -593,7 +593,7 @@ services:
- db - db
db: db:
image: postgis/postgis:14-3.1-alpine image: postgis/postgis:14-3.3-alpine
restart: unless-stopped restart: unless-stopped
environment: environment:
- POSTGRES_DB=db - POSTGRES_DB=db
@ -645,7 +645,7 @@ services:
- db - db
db: db:
image: postgis/postgis:14-3.1-alpine image: postgis/postgis:14-3.3-alpine
restart: unless-stopped restart: unless-stopped
environment: environment:
- POSTGRES_DB=db - POSTGRES_DB=db
@ -758,16 +758,24 @@ martin postgres://postgres@localhost/db
cd martin cd martin
just just
Available recipes: Available recipes:
run # Start Martin server and a test database 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 # Perform cargo clean to delete all build files
clean-test # Delete test output files clean-test # Delete test output files
start-db # Start a test database 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 stop # Stop the test database
bench # Run benchmark tests bench # Run benchmark tests
test # Run all tests using a test database test # Run all tests using a test database
test-unit # Run Rust unit tests (cargo test) test-unit # Run Rust unit and doc tests (cargo test)
test-int # Run integration tests 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 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. git *ARGS # Do any git command, ensuring that the testing environment is set up. Accepts the same arguments as git.
``` ```

View File

@ -30,7 +30,7 @@ services:
- ./tests/fixtures/initdb-dc.sh:/docker-entrypoint-initdb.d/20_martin.sh - ./tests/fixtures/initdb-dc.sh:/docker-entrypoint-initdb.d/20_martin.sh
db-legacy: db-legacy:
image: postgis/postgis:9.6-2.5-alpine image: postgis/postgis:11-3.0-alpine
restart: unless-stopped restart: unless-stopped
ports: ports:
- "5432:5432" - "5432:5432"

View File

@ -25,8 +25,14 @@ clean-test:
rm -rf tests/output rm -rf tests/output
# Start a test database # Start a test database
start-db: start-db: (docker-up "db")
docker-compose up -d 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 _down := stop
alias _stop-db := stop alias _stop-db := stop
@ -49,7 +55,13 @@ test-unit: start-db
cargo test --doc cargo test --doc
# Run integration tests # 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 #!/usr/bin/env sh
tests/test.sh tests/test.sh
# echo "** Skipping comparison with the expected values - not yet stable" # echo "** Skipping comparison with the expected values - not yet stable"