From ee1d31781cf0d292a50b4df4cb8cb6ffcbfbe9af Mon Sep 17 00:00:00 2001 From: Darren Tucker Date: Sun, 11 May 2025 16:35:31 +1000 Subject: [PATCH] Move debug log output into separate workflow step. Should reduce the need to scroll back to find out which test actually failed. --- .github/run_test.sh | 12 ------------ .github/workflows/c-cpp.yml | 3 +++ .github/workflows/selfhosted.yml | 3 +++ 3 files changed, 6 insertions(+), 12 deletions(-) diff --git a/.github/run_test.sh b/.github/run_test.sh index 74ab2423c..bd6fb7b7b 100755 --- a/.github/run_test.sh +++ b/.github/run_test.sh @@ -21,18 +21,6 @@ if [ ! -z "$SUDO" ] && [ ! -z "$TEST_SSH_HOSTBASED_AUTH" ]; then done fi -output_failed_logs() { - for i in regress/failed*.log; do - if [ -f "$i" ]; then - echo ------------------------------------------------------------------------- - echo LOGFILE $i - cat $i - echo ------------------------------------------------------------------------- - fi - done -} -trap output_failed_logs 0 - env="" if [ ! -z "${SUDO}" ]; then env="${env} SUDO=${SUDO}" diff --git a/.github/workflows/c-cpp.yml b/.github/workflows/c-cpp.yml index d83ecd9c3..91b07ed97 100644 --- a/.github/workflows/c-cpp.yml +++ b/.github/workflows/c-cpp.yml @@ -149,6 +149,9 @@ jobs: env: TEST_SSH_UNSAFE_PERMISSIONS: 1 TEST_SSH_HOSTBASED_AUTH: yes + - name: show logs + if: failure() + run: for i in regress/failed*.log; do echo ====; echo logfile $i; echo =====; cat $i; done - name: save logs if: failure() uses: actions/upload-artifact@main diff --git a/.github/workflows/selfhosted.yml b/.github/workflows/selfhosted.yml index d892a28c3..9f2bd99eb 100644 --- a/.github/workflows/selfhosted.yml +++ b/.github/workflows/selfhosted.yml @@ -129,6 +129,9 @@ jobs: - name: make tests run: vmrun ./.github/run_test.sh ${{ matrix.config }} timeout-minutes: 600 + - name: show logs + if: failure() + run: vmrun 'for i in regress/failed*.log; do echo ====; echo logfile $i; echo =====; cat $i; done' - name: save logs if: failure() uses: actions/upload-artifact@main -- 2.47.3