Skip to content

Commit

Permalink
Improve output on gradle check timeout
Browse files Browse the repository at this point in the history
The result ends up being reported as 'null' when this script times out.
The output never directly indicates that a timeout occurred, so this
commit makes the output more explicit.

Signed-off-by: Andrew Ross <andrross@amazon.com>
  • Loading branch information
andrross committed Nov 17, 2022
1 parent 86591c1 commit ba2410a
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions scripts/gradle/gradle-check.sh
Original file line number Diff line number Diff line change
Expand Up @@ -53,19 +53,22 @@ if [ -z "$QUEUE_URL" ] || [ "$QUEUE_URL" != "null" ]; then
RUNNING=$(curl -s -XGET ${WORKFLOW_URL}api/json | jq --raw-output .building)
done

echo "Complete the run, checking results now......"
RESULT=$(curl -s -XGET ${WORKFLOW_URL}api/json | jq --raw-output .result)
if [ "$RUNNING" = "true" ]; then
echo "Timed out"
RESULT="TIMEOUT"
else
echo "Complete the run, checking results now......"
RESULT=$(curl -s -XGET ${WORKFLOW_URL}api/json | jq --raw-output .result)
fi

fi
fi

echo "Please check jenkins url for logs: $WORKFLOW_URL"

echo "Result: $RESULT"
if [ "$RESULT" == "SUCCESS" ] || [ "$RESULT" == "UNSTABLE" ]; then
echo "Result: $RESULT"
echo "Get codeCoverage.xml" && curl -SLO ${WORKFLOW_URL}artifact/codeCoverage.xml
echo 0
exit 0
else
echo "Result: $RESULT"
exit 1
fi

0 comments on commit ba2410a

Please sign in to comment.