Skip to content

Commit 89dc0b2

Browse files
authored
Merge pull request #523 from hhorak/test-pipefail
Add a test suggested in PR where we added pipefail
2 parents 6a32fc1 + 6c2f02e commit 89dc0b2

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

test/run_migration_test

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,4 +53,16 @@ assert_migration_succeeds ()
5353
container_from= container_to=
5454
}
5555

56+
# test case suggested in https://github.com/sclorg/postgresql-container/pull/521
57+
assert_migration_fails()
58+
{
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
60+
info "The image exited with 0 despite migration obviously did not work, that's a problem."
61+
return 1
62+
else
63+
info "The image exited with non-zero exit code when migration obviously did not work, which is correct"
64+
fi
65+
}
66+
5667
assert_migration_succeeds pagila
68+
assert_migration_fails

0 commit comments

Comments
 (0)