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 24, 2024
1 parent aa06597 commit e8542c6
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions test/main.sh
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,22 @@ 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

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

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

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

0 comments on commit e8542c6

Please sign in to comment.