Skip to content

Commit 6c2f02e

Browse files
committed
Run the migration command directly in the if-statement
Since there is set -e set, it would fail too early even if the container worked as expected.
1 parent b3baf10 commit 6c2f02e

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

test/run_migration_test

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,7 @@ assert_migration_succeeds ()
5656
# test case suggested in https://github.com/sclorg/postgresql-container/pull/521
5757
assert_migration_fails()
5858
{
59-
docker run --rm -e POSTGRESQL_MIGRATION_REMOTE_HOST=invalid-host-name -e POSTGRESQL_MIGRATION_ADMIN_PASSWORD=password "$image_to" run-postgresql --version
60-
if [ $? -eq 0 ] ; then
59+
if docker run --rm -e POSTGRESQL_MIGRATION_REMOTE_HOST=invalid-host-name -e POSTGRESQL_MIGRATION_ADMIN_PASSWORD=password "$image_to" run-postgresql --version ; then
6160
info "The image exited with 0 despite migration obviously did not work, that's a problem."
6261
return 1
6362
else

0 commit comments

Comments
 (0)