mirror of
https://github.com/flatcar/scripts.git
synced 2025-12-09 03:11:49 +01:00
ci-automation: Use an array for storing failed tests
This commit is contained in:
parent
8cd06230ba
commit
8b52a9b04c
@ -155,6 +155,7 @@ function _test_run_impl() {
|
|||||||
local retry=""
|
local retry=""
|
||||||
local success=false
|
local success=false
|
||||||
local print_give_up=true
|
local print_give_up=true
|
||||||
|
local failed_tests=()
|
||||||
# A job on each worker prunes old mantle images (docker image prune)
|
# A job on each worker prunes old mantle images (docker image prune)
|
||||||
echo "docker rm -f '${container_name}'" >> ./ci-cleanup.sh
|
echo "docker rm -f '${container_name}'" >> ./ci-cleanup.sh
|
||||||
|
|
||||||
@ -189,9 +190,8 @@ function _test_run_impl() {
|
|||||||
"${tap_merged_summary}" \
|
"${tap_merged_summary}" \
|
||||||
"${tap_merged_detailed}"
|
"${tap_merged_detailed}"
|
||||||
|
|
||||||
local failed_tests
|
readarray -t failed_tests <"${tests_dir}/${failfile}"
|
||||||
failed_tests="$(cat "${tests_dir}/${failfile}")"
|
if [ "${#failed_tests[@]}" -eq 0 ] ; then
|
||||||
if [ -z "$failed_tests" ] ; then
|
|
||||||
echo "########### All tests succeeded. ###########"
|
echo "########### All tests succeeded. ###########"
|
||||||
success=true
|
success=true
|
||||||
print_give_up=false
|
print_give_up=false
|
||||||
@ -201,7 +201,7 @@ function _test_run_impl() {
|
|||||||
if retest_cycle_broken; then
|
if retest_cycle_broken; then
|
||||||
echo "########### Test cycle requested to break ###########"
|
echo "########### Test cycle requested to break ###########"
|
||||||
echo "Failed tests:"
|
echo "Failed tests:"
|
||||||
echo "${failed_tests}"
|
printf '%s\n' "${failed_tests[@]}"
|
||||||
echo "-----------"
|
echo "-----------"
|
||||||
print_give_up=false
|
print_give_up=false
|
||||||
break
|
break
|
||||||
@ -209,9 +209,9 @@ function _test_run_impl() {
|
|||||||
|
|
||||||
echo "########### Some tests failed and will be re-run (${retry} / ${retries}). ###########"
|
echo "########### Some tests failed and will be re-run (${retry} / ${retries}). ###########"
|
||||||
echo "Failed tests:"
|
echo "Failed tests:"
|
||||||
echo "${failed_tests}"
|
printf '%s\n' "${failed_tests[@]}"
|
||||||
echo "-----------"
|
echo "-----------"
|
||||||
set -- $failed_tests
|
set -- "${failed_tests[@]}"
|
||||||
done
|
done
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user