Skip to content

Commit

Permalink
Updated e2e.bash (ish-app#804)
Browse files Browse the repository at this point in the history
The script now does not fail if no tests were run. The crash occurred because the script tried to divide by $NUM_TOTAL even though this would be 0.
  • Loading branch information
OrangeFran authored Jun 27, 2020
1 parent 5cd6953 commit f04217d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions tests/e2e/e2e.bash
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,11 @@ for e2e_test in $(ls tests/e2e | grep -E "^[a-zA-Z0-9_]+$" | grep -E "$TEST_PATT
fi
done

if [ "$NUM_TOTAL" -eq 0 ]; then
printf "### No tests were run" | tee -a "$SUMMARY_LOG"
exit 0
fi

NUM_PASSES=$((NUM_TOTAL-NUM_FAILS))
PERCENT_PASSES=$(echo "scale=2; 100 * $NUM_PASSES / $NUM_TOTAL" | bc)
PASSED_STR="$NUM_PASSES/$NUM_TOTAL ($PERCENT_PASSES%)"
Expand Down

0 comments on commit f04217d

Please sign in to comment.