From 0411e9ee734a998663a56d8ea8d26605b18b2d10 Mon Sep 17 00:00:00 2001 From: Wesley Hershberger Date: Mon, 23 Sep 2024 14:45:01 -0500 Subject: [PATCH] test: Don't collapse dmesg in CI when there's a kernel call trace Signed-off-by: Wesley Hershberger --- test/main.sh | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/test/main.sh b/test/main.sh index fdb5ad59123f..85994057e11c 100755 --- a/test/main.sh +++ b/test/main.sh @@ -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