From 6765631848ab02b0fa3d7648bf48149eb2a5a840 Mon Sep 17 00:00:00 2001 From: Justin Clift Date: Thu, 3 Oct 2024 18:23:42 +1000 Subject: [PATCH] Add the re-creation of the not-upgraded-pg data directory --- test.sh | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/test.sh b/test.sh index b5351e5..8c9ed4d 100755 --- a/test.sh +++ b/test.sh @@ -54,6 +54,18 @@ test_run() { # Shut down containers from previous test runs docker compose -f docker-compose-pgauto.yml down + ## + ## Tests for one shot mode + ## + banner '-' "Testing 'one shot' automatic upgrade mode for PostgreSQL ${VERSION} to ${TARGET}" + + # Delete the upgraded PostgreSQL data directory + sudo rm -rf postgres-data + + # Create the PostgreSQL database using a specific version of PostgreSQL + docker compose -f "docker-compose-pg${VERSION}.yml" run --rm --remove-orphans server create_db + + # If running on CI, delete the Postgres Docker image to avoid space problems if [ -n "$CI" ]; then docker rmi -f $(docker images postgres -q)