From f99954c01f6f105fa80a42b4cdb4da4d18a0abbe Mon Sep 17 00:00:00 2001 From: Brian Behlendorf Date: Fri, 17 Apr 2026 17:21:13 -0700 Subject: [PATCH] CI: tolerate missing artifacts When a VM fails to launch or is unreachable the qemu-7-prepare.sh script will fail to collect the artifacts due to the missing vm* directories. We want to collect as much diagnostic information as possible, when missing create the directory to allow the subsequent steps to proceed normally. Additionally, we don't want to fail if the /tmp/summary.txt file is missing. Reviewed-by: Tony Hutter Signed-off-by: Brian Behlendorf Closes #18438 --- .github/workflows/scripts/qemu-7-prepare.sh | 7 +++++-- .github/workflows/scripts/qemu-8-summary.sh | 8 +++++--- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/.github/workflows/scripts/qemu-7-prepare.sh b/.github/workflows/scripts/qemu-7-prepare.sh index 5e18f4bf4..87def9fa6 100755 --- a/.github/workflows/scripts/qemu-7-prepare.sh +++ b/.github/workflows/scripts/qemu-7-prepare.sh @@ -51,6 +51,11 @@ cd $RESPATH # prepare result files for summary for ((i=1; i<=VMs; i++)); do + + # no results, VM either didn't start or was unreachable, create + # the missing directory which is expected by subsequent steps + test -d vm$i || mkdir -p vm$i + file="vm$i/build-stderr.txt" test -s $file && mv -f $file build-stderr.txt @@ -62,8 +67,6 @@ for ((i=1; i<=VMs; i++)); do file="vm$i/tests-exitcode.txt" if [ ! -s $file ]; then - # XXX - add some tests for kernel panic's here - # tail -n 80 vm$i/console.txt | grep XYZ echo 1 > $file fi rv=$(cat vm$i/tests-exitcode.txt) diff --git a/.github/workflows/scripts/qemu-8-summary.sh b/.github/workflows/scripts/qemu-8-summary.sh index 00a4bf1ae..39b3d124c 100755 --- a/.github/workflows/scripts/qemu-8-summary.sh +++ b/.github/workflows/scripts/qemu-8-summary.sh @@ -37,9 +37,11 @@ function showfile_tail() { echo "##[endgroup]" } -# overview -cat /tmp/summary.txt -echo "" +# overview if available +if [ -f /tmp/summary.txt -a -s /tmp/summary.txt ]; then + cat /tmp/summary.txt + echo "" +fi if [ -f /tmp/have_failed_tests -a -s /tmp/failed.txt ]; then echo "Debuginfo of failed tests:"