Skip to content

Commit

Permalink
Add the one shot testing back
Browse files Browse the repository at this point in the history
  • Loading branch information
justinclift committed Oct 3, 2024
1 parent 6765631 commit 2837282
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ test_run() {
banner '*' "Standard automatic upgrade of PostgreSQL from version ${VERSION} to ${TARGET} SUCCEEDED!"
fi

# Shut down containers from previous test runs
# Shut down any containers that are still running
docker compose -f docker-compose-pgauto.yml down

##
Expand All @@ -65,6 +65,21 @@ test_run() {
# 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

# Run the PostgreSQL container in one shot mode
TARGET_TAG="${TARGET}-${FLAVOR}" docker compose -f docker-compose-pgauto.yml run --rm --remove-orphans \
-e PGAUTO_ONESHOT=yes postgres

# Verify the PostgreSQL data files are now the target version
PGVER=$(sudo cat postgres-data/PG_VERSION)
if [ "$PGVER" != "${TARGET}" ]; then
banner '*' "'One shot' automatic upgrade of PostgreSQL from version ${VERSION} to ${TARGET} FAILED!"
FAILURE=1
else
banner '*' "'One shot' automatic upgrade of PostgreSQL from version ${VERSION} to ${TARGET} SUCCEEDED!"
fi

# Shut down any containers that are still running
docker compose -f docker-compose-pgauto.yml down

# If running on CI, delete the Postgres Docker image to avoid space problems
if [ -n "$CI" ]; then
Expand Down

0 comments on commit 2837282

Please sign in to comment.