From c7b9b33097e05801216e113d076b7156e89293d7 Mon Sep 17 00:00:00 2001 From: Rich Megginson Date: Mon, 21 Apr 2025 16:43:44 -0600 Subject: [PATCH] ci: use tox-lsr 3.6.0; improve qemu test logging tox-lsr 3.6.0 will guarantee order of qemu test execution, which should help make tests reproducible and help debug test failures. Improve qemu test logging - this will help debug the qemu test failures. Signed-off-by: Rich Megginson --- .github/workflows/ansible-lint.yml | 2 +- .../workflows/ansible-managed-var-comment.yml | 2 +- .github/workflows/ansible-test.yml | 2 +- .../workflows/qemu-kvm-integration-tests.yml | 25 +++++++++++++++---- 4 files changed, 23 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ansible-lint.yml b/.github/workflows/ansible-lint.yml index c6c1852..83ccb89 100644 --- a/.github/workflows/ansible-lint.yml +++ b/.github/workflows/ansible-lint.yml @@ -32,7 +32,7 @@ jobs: - name: Install tox, tox-lsr run: | set -euxo pipefail - pip3 install "git+https://github.com/linux-system-roles/tox-lsr@3.5.1" + pip3 install "git+https://github.com/linux-system-roles/tox-lsr@3.6.0" - name: Convert role to collection format id: collection diff --git a/.github/workflows/ansible-managed-var-comment.yml b/.github/workflows/ansible-managed-var-comment.yml index 99bf5d5..eadd836 100644 --- a/.github/workflows/ansible-managed-var-comment.yml +++ b/.github/workflows/ansible-managed-var-comment.yml @@ -30,7 +30,7 @@ jobs: - name: Install tox, tox-lsr run: | set -euxo pipefail - pip3 install "git+https://github.com/linux-system-roles/tox-lsr@3.5.1" + pip3 install "git+https://github.com/linux-system-roles/tox-lsr@3.6.0" - name: Run ansible-plugin-scan run: | diff --git a/.github/workflows/ansible-test.yml b/.github/workflows/ansible-test.yml index b98f69b..f97384b 100644 --- a/.github/workflows/ansible-test.yml +++ b/.github/workflows/ansible-test.yml @@ -33,7 +33,7 @@ jobs: - name: Install tox, tox-lsr run: | set -euxo pipefail - pip3 install "git+https://github.com/linux-system-roles/tox-lsr@3.5.1" + pip3 install "git+https://github.com/linux-system-roles/tox-lsr@3.6.0" - name: Convert role to collection format run: | diff --git a/.github/workflows/qemu-kvm-integration-tests.yml b/.github/workflows/qemu-kvm-integration-tests.yml index 2d65444..60e43cd 100644 --- a/.github/workflows/qemu-kvm-integration-tests.yml +++ b/.github/workflows/qemu-kvm-integration-tests.yml @@ -74,7 +74,7 @@ jobs: python3 -m pip install --upgrade pip sudo apt update sudo apt install -y --no-install-recommends git ansible-core genisoimage qemu-system-x86 - pip3 install "git+https://github.com/linux-system-roles/tox-lsr@3.5.1" + pip3 install "git+https://github.com/linux-system-roles/tox-lsr@3.6.0" - name: Configure tox-lsr if: steps.check_platform.outputs.supported @@ -109,14 +109,29 @@ jobs: echo "$f" done < batch.report - - name: Show test logs on failure + - name: Upload test logs on failure + if: failure() + uses: actions/upload-artifact@v4 + with: + name: "logs-${{ matrix.scenario.image }}-${{ matrix.scenario.env }}" + path: | + tests/*.log + artifacts/default_provisioners.log + artifacts/*.qcow2.*.log + batch.txt + batch.report + retention-days: 30 + + - name: Show test log failures if: steps.check_platform.outputs.supported && failure() run: | set -euo pipefail for f in tests/*.log; do - echo "::group::$(basename $f)" - cat "$f" - echo "::endgroup::" + if FAIL=$(grep -B100 -A30 "fatal:" "$f"); then + echo "::group::$(basename $f)" + echo "$FAIL" + echo "::endgroup::" + fi done - name: Set commit status as success with a description that platform is skipped