From 4b4c8abc691f385db6926224953f0f18f6d0543f Mon Sep 17 00:00:00 2001 From: Andrew Ross Date: Wed, 16 Nov 2022 09:17:14 -0800 Subject: [PATCH] Improve output on gradle check timeout 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 --- scripts/gradle/gradle-check.sh | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/scripts/gradle/gradle-check.sh b/scripts/gradle/gradle-check.sh index 1586e9b790..3f19dcfba0 100644 --- a/scripts/gradle/gradle-check.sh +++ b/scripts/gradle/gradle-check.sh @@ -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