Skip to content

Commit

Permalink
ZTS: Fix Test Summary page generation
Browse files Browse the repository at this point in the history
Fix that error: "cat /tmp/failed.txt: No such file or directory"

Reviewed-by: Brian Behlendorf <[email protected]>
Reviewed-by: Tony Hutter <[email protected]>
Signed-off-by: Tino Reichardt <[email protected]>
Closes openzfs#16549
  • Loading branch information
mcmilk committed Sep 20, 2024
1 parent 035798a commit 9eefbac
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
7 changes: 5 additions & 2 deletions .github/workflows/scripts/qemu-7-prepare.sh
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,11 @@ for i in $(seq 1 $VMs); do
test -s $file && mv -f $file uname.txt

file="vm$i/tests-exitcode.txt"
test -s $file || echo 1 > $file
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)
test $rv != 0 && touch /tmp/have_failed_tests

Expand Down Expand Up @@ -89,7 +93,6 @@ fi
cat summary.txt \
| awk '/\(expected PASS\)/{ if ($1!="SKIP") print $2; next; } show' \
| while read t; do
echo "check: $t"
cat summary-failure-logs.txt \
| awk '$0~/Test[: ]/{ show=0; } $0~v{ show=1; } show' v="$t" \
> /tmp/fail.txt
Expand Down
8 changes: 3 additions & 5 deletions .github/workflows/scripts/qemu-8-summary.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,12 @@ EOF
cat /tmp/summary.txt
echo ""

if [ -e /tmp/have_failed_tests ]; then
RV=1
if [ -f /tmp/have_failed_tests -a -s /tmp/failed.txt ]; then
echo "Debuginfo of failed tests:"
cat /tmp/failed.txt
echo ""
cat /tmp/summary.txt | grep -v '^/'
echo ""
else
RV=0
fi

echo -e "\nFull logs for download:\n $1\n"
Expand All @@ -70,4 +67,5 @@ for i in $(seq 1 $VMs); do
test -s "$file" && showfile "$file" "$vm: failure logfile"
done

exit $RV
test -f /tmp/have_failed_tests && exit 1
exit 0

0 comments on commit 9eefbac

Please sign in to comment.