Skip to content

Commit

Permalink
fix: run health check only if activated
Browse files Browse the repository at this point in the history
  • Loading branch information
opicaud committed Jan 5, 2024
1 parent bcc59ec commit e127a29
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions private/pact/templates/pact_test.template.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@
_healthCheck () {
echo "starting health check of $2"
healthy="503"
uri=$(cat $1)
if [ $1 == "nop" ]; then healthy="200" && echo "health check ignored"; fi
attempt=0
until [ $healthy = "200" ]
do
healthy=$(curl -s -o /dev/null -w "%{http_code}" $1)
healthy=$(curl -s -o /dev/null -w "%{http_code}" $uri)
echo "health check of $2 not ok, will recheck in 1 sec.."
sleep 1
done
Expand Down Expand Up @@ -55,7 +56,7 @@ nohup {provider_bin} &
echo "### Starting SideCar {side_car_bin} as State Manager ###"
nohup {side_car_bin} &
echo "### Health Check SideCar ###"
#_healthCheck $(cat {health_check_side_car}) "side_car"
_healthCheck {health_check_side_car} "side_car"

echo "### Running Pact test $contract on Provider"
./{pact_verifier_cli} $cli_args

0 comments on commit e127a29

Please sign in to comment.