Skip to content

Commit 0b6020f

Browse files
martinpittrichm
authored andcommitted
ci: Avoid too large inline test logs in QEMU/KVM integration test
Some roles produce ansible/test logs which are too large to sensibly/comfortably view in the main workflow log view. Show only the interesting failures there (the lines around `fatal:`) and upload the full logs as artifact.
1 parent fc643b7 commit 0b6020f

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

.github/workflows/qemu-kvm-integration-tests.yml

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -109,14 +109,24 @@ jobs:
109109
echo "$f"
110110
done < batch.report
111111
112-
- name: Show test logs on failure
112+
- name: Upload test logs on failure
113+
if: failure()
114+
uses: actions/upload-artifact@v4
115+
with:
116+
name: "logs-${{ matrix.scenario.image }}-${{ matrix.scenario.env }}"
117+
path: tests/*.log
118+
retention-days: 30
119+
120+
- name: Show test log failures
113121
if: steps.check_platform.outputs.supported && failure()
114122
run: |
115123
set -euo pipefail
116124
for f in tests/*.log; do
117-
echo "::group::$(basename $f)"
118-
cat "$f"
119-
echo "::endgroup::"
125+
if FAIL=$(grep -B100 -A30 "fatal:" "$f"); then
126+
echo "::group::$(basename $f)"
127+
echo "$FAIL"
128+
echo "::endgroup::"
129+
fi
120130
done
121131
122132
- name: Set commit status as success with a description that platform is skipped

0 commit comments

Comments
 (0)