From e9726276247ab44af49c3cda699acd0f71165026 Mon Sep 17 00:00:00 2001 From: "Matthieu Baerts (NGI0)" Date: Fri, 22 Mar 2024 19:37:32 +0100 Subject: [PATCH] failed tests: also catch kunit/packetdrill errors Because the script expect to see 'not ok [0-9]+ test: ' in _get_failed_tests() -- not to list subtests -- so we need to print the not ok' message in this format as well. Signed-off-by: Matthieu Baerts (NGI0) --- entrypoint.sh | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/entrypoint.sh b/entrypoint.sh index 17f8a3c..f65b41a 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -1307,18 +1307,17 @@ _has_failed_tests() { } # $1: prefix -_print_tests_results_subtests() { local tap +_print_tests_results_subtests() { local tap ok="ok" for tap in "${RESULTS_DIR}/${1}"*.tap; do [[ "${tap}" = *"_*.tap" ]] && continue - if ! grep -q "^not ok " "${tap}"; then - echo "ok 1 test: $(basename "${tap}" ".tap")" - fi + grep -q "^not ok " "${tap}" && ok="not ok" + echo "${ok} 1 test: $(basename "${tap}" ".tap")" done } _print_tests_result() { echo "All tests:" - grep --no-filename -e "^ok 1 test: " -e "^not ok " "${RESULTS_DIR}"/*.tap + grep --no-filename -e "^ok [0-9]\+ test: " -e "^not ok " "${RESULTS_DIR}"/*.tap _print_tests_results_subtests "kunit_" _print_tests_results_subtests "packetdrill_" }