From 8d711d060690f82cb8e4db871b09881a35243e70 Mon Sep 17 00:00:00 2001 From: ra0x3 Date: Mon, 2 Oct 2023 15:00:38 -0400 Subject: [PATCH] fix ci attempt --- .../scripts/test-examples.bash | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/packages/fuel-indexer-tests/scripts/test-examples.bash b/packages/fuel-indexer-tests/scripts/test-examples.bash index 46efec4ca..501c8ee85 100644 --- a/packages/fuel-indexer-tests/scripts/test-examples.bash +++ b/packages/fuel-indexer-tests/scripts/test-examples.bash @@ -59,14 +59,24 @@ sleep 2 cd ../greetings-native -# Start the local Fuel node in the background (that we already previously built) -cargo run -p greetings-fuel-client --bin greetings-fuel-client & -sleep 2 +# Fuel client has already been started... # Start indexer in the background forc-index run-native --path ./greetings-native-indexer -- --run-migrations --postgres-password my-secret & sleep 5 +# Ensure service is up and running via health check +db_status=$(curl http://localhost:29987/api/health | json_pp | jq '.database_status') +sleep 1 +client_status=$(curl http://localhost:29987/api/health | json_pp | jq '.client_status') + +if [[ "$db_status" == "$client_status" ]] && [[ "$db_status" == '"OK"' ]]; then + echo "Database and client are up and running." +else + echo "Database and/or client are not up and running." + exit 1 +fi + # Trigger an indexable event cargo run -p greetings-data --bin greetings-data sleep 2