Skip to content
This repository has been archived by the owner on Apr 30, 2024. It is now read-only.

Commit

Permalink
try another suggestion
Browse files Browse the repository at this point in the history
  • Loading branch information
Connor O'Hara committed Jul 26, 2023
1 parent 200c89c commit 26e3f5e
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions gm-tester.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,25 @@ RETRY_COUNT=0
# Loop until the result is not equal to the expected string or maximum retries are reached
while [[ $RETRY_COUNT -lt $MAX_RETRIES ]]; do
# Execute the curl command and capture the result
RESULT=$(curl -s "$URL" | jq -r '.result')
RESULT=$(curl -s "$URL")

# Compare the result with the expected string or null string
if [["$RESULT" != "null"]]; then
echo "Success! The result is now not null. Specifically, it's:"
if jq -e '.result' <<< "$RESULT" > /dev/null; then
echo "Success! The result is now different from the error"
echo "got result:"
echo $RESULT
echo "but we expected this:"
echo $EXPECTED_RESULT
if [ -z "$RESULT" ]; then
echo "Result is null. not good"
else
echo "result is NOT NULL"
fi
exit 0
break
fi
echo "i think the result is null."
echo "EXPECTED " $EXPECTED_RESULT
echo "GOT " $RESULT

# Increment the retry count
((RETRY_COUNT++))
Expand Down

0 comments on commit 26e3f5e

Please sign in to comment.