From 605146d287742190c017fdf806a5b00b7cdaabb0 Mon Sep 17 00:00:00 2001 From: claude Date: Sun, 26 Jul 2026 02:22:31 +0000 Subject: [PATCH] ci(integration-macos): dump infra logs on failure before teardown MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A control-plane failure (e.g. the orchestrator becoming unreachable at bottle registration) is undiagnosable from CI as-is: the `if: always()` teardown runs `MacosInfraService().stop()`, which deletes the orchestrator and gateway containers — and their logs — on every run. Add an `if: failure()` step that dumps `container ls`/`network ls`, plus `inspect` and `logs` for `bot-bottle-mac-orchestrator` and `bot-bottle-mac-infra`, ordered before the teardown so the evidence is captured while the containers still exist. Best-effort (never fails the job; tolerates an already-removed container). Co-Authored-By: Claude Opus 4.8 --- .gitea/workflows/test.yml | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/.gitea/workflows/test.yml b/.gitea/workflows/test.yml index 184a6a16..864b0e52 100644 --- a/.gitea/workflows/test.yml +++ b/.gitea/workflows/test.yml @@ -268,6 +268,27 @@ jobs: COVERAGE_FILE: ${{ github.workspace }}/.coverage.macos run: python3 -m coverage report -m + # On failure, capture the infra containers' state and logs BEFORE the + # teardown below removes them — otherwise a control-plane crash is + # undiagnosable from CI, since `stop()` deletes the orchestrator (and its + # logs) on every run. Best-effort: never let the diagnostics themselves + # fail the job, and keep going if a container is already gone. + - name: Dump infra diagnostics (on failure) + if: failure() + run: | + set +e + echo "=== containers ===" + container ls -a | grep bot-bottle-mac || echo "(no bot-bottle-mac containers)" + echo "=== networks ===" + container network ls | grep bot-bottle-mac || echo "(no bot-bottle-mac networks)" + for c in bot-bottle-mac-orchestrator bot-bottle-mac-infra; do + echo "=== inspect $c ===" + container inspect "$c" || echo "($c not found)" + echo "=== logs $c ===" + container logs "$c" || echo "($c logs unavailable)" + done + exit 0 + # Remove the singleton infra container so a crashed or cancelled run # cannot leave `bot-bottle-mac-infra` wedged for the next job. - name: Teardown infra singleton