Skip to content

Commit

Permalink
Remove FAILED variable, use array length
Browse files Browse the repository at this point in the history
  • Loading branch information
avdv committed Sep 21, 2022
1 parent 06ca7d1 commit 218f741
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions .github/build-and-test
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,11 @@ SCRIPT_DIR="${SCRIPT_DIR%/*}"

cd "$( dirname "$SCRIPT_DIR" )"

declare -i FAILED=0
declare -a FAILURES=( )

function on_exit() {
echo
if [[ "$FAILED" -gt 0 ]]; then
if [[ "${#FAILURES[@]}" -gt 0 ]]; then
echo "error: running tests in ${FAILURES[@]} was not successful"
exit 1
elif [[ $? -eq 0 ]]; then
Expand All @@ -41,7 +40,6 @@ for dir in "${dirs[@]}"; do

pushd $dir >/dev/null
if ! bazel test //... ; then
let ++FAILED
FAILURES+=( "$dir" )
fi
bazel shutdown
Expand Down

0 comments on commit 218f741

Please sign in to comment.