Skip to content

Commit

Permalink
Make check_health in tests easier to debug
Browse files Browse the repository at this point in the history
  • Loading branch information
nineinchnick authored and hashhar committed Sep 12, 2023
1 parent 60c127c commit f8dd106
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion bin/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,15 @@ function run_spark_tests() {

function check_health() {
local service=$1
test "$(environment_compose ps --format json | jq -er --arg name "$service" '.[] | select(.Service == $name) | .Health')" == "healthy"
if ! list=$(environment_compose ps --format json); then
echo >&2 "Error getting Docker containers status: $list"
return 1
fi
if ! status=$(jq -er --arg name "$service" '.[] | select(.Service == $name) | .Health' <<<"$list"); then
echo >&2 "Error getting health for $service: $status"
return 1
fi
test "$status" == "healthy"
}

function run_gpdb_tests() {
Expand Down

0 comments on commit f8dd106

Please sign in to comment.