From 1aed48f0bf5cf88b6c5b8f44e5ffb75a7fe3b187 Mon Sep 17 00:00:00 2001 From: sharkAndshar Date: Thu, 9 Jan 2025 10:51:51 +0800 Subject: [PATCH] add test-latest to justfile --- docker-compose.yml | 22 ++++++++++++++++++++++ justfile | 6 ++++++ 2 files changed, 28 insertions(+) diff --git a/docker-compose.yml b/docker-compose.yml index 96f7a3af2..1d5054aaa 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -45,6 +45,28 @@ services: - ./tests/fixtures:/fixtures - ./tests/fixtures/initdb-dc.sh:/docker-entrypoint-initdb.d/20_martin.sh + db-latest: + # This should match the version of postgres used in the CI workflow + image: postgis/postgis:latest + restart: unless-stopped + ports: + - '${PGPORT:-5411}:5432' + command: + - '-c' + - 'max_connections=200' + environment: + # POSTGRES_* variables are used by the postgis/postgres image + # PG_* variables are used by psql + - POSTGRES_DB=db + - POSTGRES_USER=postgres + - POSTGRES_PASSWORD=postgres + - PGDATABASE=db + - PGUSER=postgres + - PGPASSWORD=postgres + volumes: + - ./tests/fixtures:/fixtures + - ./tests/fixtures/initdb-dc.sh:/docker-entrypoint-initdb.d/20_martin.sh + db-ssl: # This should match the version of postgres used in the CI workflow image: postgis/postgis:15-3.3 diff --git a/justfile b/justfile index b072eb811..14280cdf7 100644 --- a/justfile +++ b/justfile @@ -65,6 +65,9 @@ clean-test: # Start a test database start: (docker-up "db") docker-is-ready +# Start a test latest database +start-latest: (docker-up "db-latest") docker-is-ready + # Start an ssl-enabled test database start-ssl: (docker-up "db-ssl") docker-is-ready @@ -129,6 +132,9 @@ bench-http: (cargo-install "oha") # Run all tests using a test database test: start (test-cargo "--all-targets") test-doc test-int +# Run all tests using a test database +test-latest: start-latest (test-cargo "--all-targets") test-doc test-int + # Run all tests using an SSL connection to a test database. Expected output won't match. test-ssl: start-ssl (test-cargo "--all-targets") test-doc clean-test tests/test.sh