From d8aa31e69904034ce19706516eeceb04065d7ad8 Mon Sep 17 00:00:00 2001 From: joshsiv-mulga Date: Sat, 6 Jun 2026 13:01:32 +1000 Subject: [PATCH] ci(baremetal): capture combined log + junit + analyze bundle on failure Bare-metal e2e produced no artifact, so RCA fell back to truncated log-failed output. Tee bootstrap + e2e output to test-baremetal.log, generate junit-baremetal.xml, run e2e-analyze to emit analysis.md, and upload the bundle as e2e-baremetal-artifacts-. --- .github/workflows/e2e-baremetal.yml | 36 ++++++++++++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) diff --git a/.github/workflows/e2e-baremetal.yml b/.github/workflows/e2e-baremetal.yml index 4f29cb206..d22a0e618 100644 --- a/.github/workflows/e2e-baremetal.yml +++ b/.github/workflows/e2e-baremetal.yml @@ -20,6 +20,7 @@ jobs: cancel-in-progress: false env: BM_ISO_CACHE: /var/cache/spinifex-iso-builder + ARTIFACT_DIR: /tmp/spinifex-e2e-baremetal-artifacts-${{ github.run_id }} steps: - name: Clean Workspace run: sudo rm -rf "$GITHUB_WORKSPACE"/* @@ -92,6 +93,9 @@ jobs: fi + - name: Install go-junit-report on runner + run: go install github.com/jstemmer/go-junit-report/v2@latest + - name: Run Bare-Metal E2E env: BM_CI_PASSWORD: ${{ secrets.BM_CI_PASSWORD }} @@ -100,8 +104,38 @@ jobs: BM_UBUNTU_IMAGE: ${{ env.BM_ISO_CACHE }}/ubuntu-26.04-cloudimg-amd64.img SPX_EXTERNAL_POOL: ${{ env.SPINIFEX_CI_POOL }} run: | + mkdir -p "${ARTIFACT_DIR}" + # Capture combined bootstrap + e2e output so failures produce a + # downloadable, analyzable artifact (the suites run go test -v on the + # init node and stream back over SSH). pipefail keeps the script's + # real exit code through the tee. + set -o pipefail sudo -E mulga/scripts/baremetal/run-baremetal-e2e.sh \ --vmlinuz "${BM_ISO_CACHE}/vmlinuz" \ --initrd "${BM_ISO_CACHE}/initrd.img" \ --squashfs "${BM_ISO_CACHE}/spinifex.squashfs" \ - --tests-tar "${RUNNER_TEMP}/spinifex-tests.tar" + --tests-tar "${RUNNER_TEMP}/spinifex-tests.tar" \ + 2>&1 | tee "${ARTIFACT_DIR}/test-baremetal.log" + + - name: Generate JUnit report + if: always() + run: | + LOG="${ARTIFACT_DIR}/test-baremetal.log" + [ -f "$LOG" ] || exit 0 + go-junit-report -in "$LOG" -out "${ARTIFACT_DIR}/junit-baremetal.xml" || true + + - name: Analyze e2e failures + if: always() + uses: ./.github/actions/e2e-analyze + with: + junit-glob: ${{ env.ARTIFACT_DIR }}/junit-*.xml + log-dir: ${{ env.ARTIFACT_DIR }} + title: "Bare-Metal E2E failure analysis" + + - uses: actions/upload-artifact@v7 + if: always() + with: + name: e2e-baremetal-artifacts-${{ github.run_id }} + path: ${{ env.ARTIFACT_DIR }} + if-no-files-found: warn + retention-days: 14