Skip to content

Commit

Permalink
Improve output on gradle check timeout (#2913)
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>

Signed-off-by: Andrew Ross <andrross@amazon.com>
  • Loading branch information
andrross authored Nov 29, 2022
1 parent 78b140d commit 65ec33a
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions scripts/gradle/gradle-check.sh
Original file line number Diff line number Diff line change
Expand Up @@ -53,19 +53,21 @@ 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
else
echo "Result: $RESULT"
exit 1
fi

0 comments on commit 65ec33a

Please sign in to comment.