From 015412bdfbafec3708023e597a242eaab7d5a31d Mon Sep 17 00:00:00 2001 From: Camila Macedo <7708031+camilamacedo86@users.noreply.github.com> Date: Tue, 26 Nov 2024 15:41:00 +0000 Subject: [PATCH] GitHub actions - began to capture logs and pod descriptions when failures occurs in the actions --- .github/workflows/e2e.yaml | 42 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/.github/workflows/e2e.yaml b/.github/workflows/e2e.yaml index 8b104d920..979efdf22 100644 --- a/.github/workflows/e2e.yaml +++ b/.github/workflows/e2e.yaml @@ -21,6 +21,20 @@ jobs: - name: Run the extension developer e2e test run: make extension-developer-e2e + - name: Collect pod logs and descriptions on failure + if: failure() + run: | + echo "Fetching pod logs and descriptions..." + kubectl get pods -n olmv1-system -o wide || true + for pod in $(kubectl get pods -n olmv1-system -o name); do + echo "Collecting logs for $pod..." + kubectl logs $pod -n olmv1-system || true + echo "Describing $pod..." + kubectl describe $pod -n olmv1-system || true + done + env: + KUBECONFIG: ${{ secrets.KUBECONFIG }} + e2e-kind: runs-on: ubuntu-latest steps: @@ -35,6 +49,20 @@ jobs: - name: Run e2e tests run: ARTIFACT_PATH=/tmp/artifacts make test-e2e + - name: Collect pod logs and descriptions on failure + if: failure() + run: | + echo "Fetching pod logs and descriptions..." + kubectl get pods -n olmv1-system -o wide || true + for pod in $(kubectl get pods -n olmv1-system -o name); do + echo "Collecting logs for $pod..." + kubectl logs $pod -n olmv1-system || true + echo "Describing $pod..." + kubectl describe $pod -n olmv1-system || true + done + env: + KUBECONFIG: ${{ secrets.KUBECONFIG }} + - uses: cytopia/upload-artifact-retry-action@v0.1.7 if: failure() with: @@ -59,3 +87,17 @@ jobs: - name: Run the upgrade e2e test run: make test-upgrade-e2e + + - name: Collect pod logs and descriptions on failure + if: failure() + run: | + echo "Fetching pod logs and descriptions..." + kubectl get pods -n olmv1-system -o wide || true + for pod in $(kubectl get pods -n olmv1-system -o name); do + echo "Collecting logs for $pod..." + kubectl logs $pod -n olmv1-system || true + echo "Describing $pod..." + kubectl describe $pod -n olmv1-system || true + done + env: + KUBECONFIG: ${{ secrets.KUBECONFIG }} \ No newline at end of file