Skip to content

Commit

Permalink
return 0 if jq fails
Browse files Browse the repository at this point in the history
Signed-off-by: mehul gautam <[email protected]>
  • Loading branch information
mehul gautam committed Jul 17, 2024
1 parent 518c4df commit bd5a86e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions scripts/hotrod-integration-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ if [[ $body != *"Rides On Demand"* ]]; then
fi

response=$(curl -i -X POST "http://localhost:8080/dispatch?customer=123")
TRACE_ID=$(echo "$response" | grep -Fi "Traceresponse" | awk '{print $2}' | cut -d '-' -f 2)
TRACE_ID=$(echo "$response" | grep -Fi "Traceresponse:" | awk '{print $2}' | cut -d '-' -f 2)

if [ -n "$TRACE_ID" ]; then
echo "TRACE_ID is not empty: $TRACE_ID"
Expand All @@ -64,7 +64,7 @@ poll_jaeger() {
local trace_id=$1
local url="${JAEGER_QUERY_URL}/api/traces/${trace_id}"

curl -s "${url}" | jq '.data[0].spans | length'
curl -s "${url}" | jq '.data[0].spans | length' || 0
}

# Polling loop
Expand Down

0 comments on commit bd5a86e

Please sign in to comment.