Skip to content

Commit

Permalink
test: Don't collapse dmesg in CI when there's a kernel call trace
Browse files Browse the repository at this point in the history
Signed-off-by: Wesley Hershberger <wesley.hershberger@canonical.com>
  • Loading branch information
MggMuggins committed Sep 23, 2024
1 parent aa06597 commit 0411e9e
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions test/main.sh
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,21 @@ cleanup() {

if [ "${TEST_RESULT}" != "success" ]; then
# dmesg may contain oops, IO errors, crashes, etc
echo "::group::dmesg logs"
# If there's a kernel stack trace, don't generate a collapsible group

if journalctl --quiet --no-hostname --no-pager --boot=0 --lines=100 --dmesg --grep "kernel: Call Trace:" > /dev/null; then
showDmesg=1
fi

if [ ! "${showDmesg}" ]; then
echo "::group::dmesg logs"
else
echo "dmesg logs"
fi
journalctl --quiet --no-hostname --no-pager --boot=0 --lines=100 --dmesg
echo "::endgroup::"
if [ ! "${showDmesg}" ]; then
echo "::endgroup::"
fi
fi

if [ -n "${GITHUB_ACTIONS:-}" ]; then
Expand Down

0 comments on commit 0411e9e

Please sign in to comment.