Skip to content

Commit

Permalink
Update result parsing script
Browse files Browse the repository at this point in the history
  • Loading branch information
loremattei committed Jan 10, 2025
1 parent 215304b commit 9a741ec
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions .github/workflows/end-to-end.yml
Original file line number Diff line number Diff line change
Expand Up @@ -107,14 +107,26 @@ jobs:
# Parse the JSON string
RESULTS='${{ steps.upload.outputs.MAESTRO_CLOUD_FLOW_RESULTS }}'
# Check if RESULTS is empty or null
if [ -z "$RESULTS" ]; then
echo "Error: No results found"
exit 1
fi
# Check if any flow was not successful
NON_SUCCESS_FLOWS=$(echo $RESULTS | jq '[.[] | select(.status != "SUCCESS")]')
NON_SUCCESS_COUNT=$(echo $NON_SUCCESS_FLOWS | jq 'length')
NON_SUCCESS_FLOWS=$(echo "$RESULTS" | jq -r '[.[] | select(.status != "SUCCESS")]')
NON_SUCCESS_COUNT=$(echo "$NON_SUCCESS_FLOWS" | jq -r 'length')

# Check if NON_SUCCESS_COUNT is a number
if ! [[ "$NON_SUCCESS_COUNT" =~ ^[0-9]+$ ]]; then
echo "Error: Invalid non-success count"
exit 1
fi

if [ "$NON_SUCCESS_COUNT" -gt 0 ]; then
echo "Error: Some flows were not successful"
echo "Details of non-successful flows:"
echo $NON_SUCCESS_FLOWS | jq '.'
echo "$NON_SUCCESS_FLOWS" | jq '.'
exit 1
else
echo "All flows were successful"
Expand Down

0 comments on commit 9a741ec

Please sign in to comment.