Skip to content

Commit

Permalink
test: return fail if any failed
Browse files Browse the repository at this point in the history
GH action status should be failed if any test failed.

Signed-off-by: Mariusz Tkaczyk <[email protected]>
  • Loading branch information
mtkaczyk committed Nov 27, 2024
1 parent 3fbdda4 commit 4447238
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions test
Original file line number Diff line number Diff line change
Expand Up @@ -150,11 +150,14 @@ do_test() {
fi
fi
restore_system_speed_limit
[ "$savelogs" == "1" ] &&
mv -f $targetdir/log $logdir/$_basename.log

[ "$savelogs" == "1" ] && mv -f $targetdir/log $logdir/$_basename.log

[ "$ctrl_c_error" == "1" ] && exit 1
[ "$_fail" == "1" -a "$exitonerror" == "1" \
-a "$_broken" == "0" ] && exit 1

[ "$_fail" == "1" -a "$exitonerror" == "1" -a "$_broken" == "0" ] && exit 1

[ "$_fail" == "1" ] && do_test_ret=1
fi
}

Expand Down Expand Up @@ -340,6 +343,8 @@ main() {
[ "$savelogs" == "1" ] &&
echo "Saving logs to $logdir"

do_test_ret=0

while true; do
if [ "x$TESTLIST" != "x" ]
then
Expand All @@ -350,11 +355,10 @@ main() {
else
for script in $testdir/$prefix $testdir/$prefix*[^~]
do
case $script in
*.broken) ;;
case $script in *.broken) ;;
*)
do_test $script
esac
esac
done
fi

Expand All @@ -365,7 +369,7 @@ main() {
done

restore_selinux
exit 0
exit $do_test_ret
}

parse_args $@
Expand Down

0 comments on commit 4447238

Please sign in to comment.