mirror of
https://pagure.io/fm-orchestrator.git
synced 2026-04-04 11:20:00 +08:00
Wait for Postgres to be running before starting the unit tests
Fixes #1314 Signed-off-by: Chenxiong Qi <cqi@redhat.com>
This commit is contained in:
@@ -64,6 +64,15 @@ if [ -n "$with_pgsql" ]; then
|
||||
-d \
|
||||
$postgres_image
|
||||
)
|
||||
|
||||
# Waiting for postgres container to start completely in case tests start too fast.
|
||||
while true
|
||||
do
|
||||
docker exec $db_bg_container psql -U postgres -c '\dp' $db_name >/dev/null 2>&1
|
||||
if [ $? == 0 ]; then
|
||||
break
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
(cd "$source_dir" && docker run "${container_opts[@]}" $test_image "$@")
|
||||
|
||||
Reference in New Issue
Block a user