From 5db3a078df872d316ec7fa5ad9b533226dfb17c3 Mon Sep 17 00:00:00 2001 From: Ihor Solodrai Date: Mon, 11 Nov 2024 09:46:50 -0800 Subject: [PATCH] Handle multiple test runners correctly --- run-vmtest/run.sh | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/run-vmtest/run.sh b/run-vmtest/run.sh index 84a5c2e..7b11141 100755 --- a/run-vmtest/run.sh +++ b/run-vmtest/run.sh @@ -69,11 +69,11 @@ foldable end bpftool_checks foldable start vmtest "Starting virtual machine..." # Tests may be comma-separated. vmtest_selftest expect them to come from CLI space-separated. -T=$(echo ${KERNEL_TEST} | tr -s ',' ' ') +TEST_RUNNERS=$(echo ${KERNEL_TEST} | tr -s ',' ' ') vmtest -k "${VMLINUZ}" --kargs "panic=-1 sysctl.vm.panic_on_oom=1" \ "${GITHUB_ACTION_PATH}/vmtest-init.sh && \ cd '${GITHUB_WORKSPACE}' && \ - ${VMTEST_SCRIPT} ${T}" + ${VMTEST_SCRIPT} ${TEST_RUNNERS}" foldable end vmtest @@ -92,13 +92,16 @@ fi foldable end collect_status -# Try to collect json summary from VM -if [[ -n ${KERNEL_TEST} && ${KERNEL_TEST} =~ test_progs* ]] -then - ## Job summary - "${GITHUB_ACTION_PATH}/print_test_summary.py" -s "${GITHUB_STEP_SUMMARY}" -j "${KERNEL_TEST}.json" +if [ -n "${TEST_RUNNERS}" ]; then + SUMMARIES=$(for runner in ${TEST_RUNNERS}; do echo "${runner}.json"; done) +else + SUMMARIES=$(find . -maxdepth 1 -name "test_*.json") fi +for summary in ${SUMMARIES}; do + "${GITHUB_ACTION_PATH}/print_test_summary.py" -s "${GITHUB_STEP_SUMMARY}" -j "${summary}" +done + # Final summary - Don't use a fold, keep it visible echo -e "\033[1;33mTest Results:\033[0m" echo -e "$exitfile" | while read result; do