diff --git a/.github/workflows/helm-e2e.yaml b/.github/workflows/helm-e2e.yaml index 10d0937c70..c6a5e79e4d 100644 --- a/.github/workflows/helm-e2e.yaml +++ b/.github/workflows/helm-e2e.yaml @@ -99,33 +99,48 @@ jobs: go run ./cmd/ate-setup --kind deploy demo egress go run ./cmd/ate-setup --kind deploy demo egress-microvm - name: Trust local E2E TLS origins + id: lanes-ready run: hack/setup-e2e-egress-tls-kind.sh + # Every focus step and lane below runs once the setup before it succeeded, + # whatever an earlier lane did, so one lane's failure never hides another + # lane's result. + # # The egress credential suite reapplies the provider policy from the # manifests when it ends, which drops the grants the credentials suite # checks. Run it after both runtimes' main lanes. - name: Focus the node on gVisor + id: focus-gvisor + if: ${{ !cancelled() && steps.lanes-ready.outcome == 'success' }} run: hack/e2e-focus-sandbox-class.sh gvisor - name: Run E2E tests (gVisor) + if: ${{ !cancelled() && steps.focus-gvisor.outcome == 'success' }} env: E2E_PARALLELISM: 8 E2E_JUNIT_FILE: ${{ github.workspace }}/_artifacts/helm-gvisor.xml run: hack/run-e2e-kind.sh -v -skip '^TestActorEgressCredentialInjection$' -args --no-color --preview="${ATE_PREVIEW}" - name: Focus the node on micro-VM + id: focus-microvm + if: ${{ !cancelled() && steps.lanes-ready.outcome == 'success' }} run: hack/e2e-focus-sandbox-class.sh microvm - name: Run E2E tests (micro-VM) + if: ${{ !cancelled() && steps.focus-microvm.outcome == 'success' }} env: E2E_SANDBOX_CLASS: microvm E2E_PARALLELISM: 8 E2E_JUNIT_FILE: ${{ github.workspace }}/_artifacts/helm-microvm.xml run: hack/run-e2e-kind.sh -v -skip '^TestActorEgressCredentialInjection$' -args --no-color --preview="${ATE_PREVIEW}" - name: Run E2E tests (egress credential injection, micro-VM) + if: ${{ !cancelled() && steps.focus-microvm.outcome == 'success' }} env: E2E_SANDBOX_CLASS: microvm E2E_JUNIT_FILE: ${{ github.workspace }}/_artifacts/helm-egress-credentials-microvm.xml run: hack/run-e2e-kind.sh ./internal/e2e/suites/egresscredinject -v -args --no-color --preview="${ATE_PREVIEW}" - name: Focus the node on gVisor + id: focus-gvisor-egress + if: ${{ !cancelled() && steps.lanes-ready.outcome == 'success' }} run: hack/e2e-focus-sandbox-class.sh gvisor - name: Run E2E tests (egress credential injection, gVisor) + if: ${{ !cancelled() && steps.focus-gvisor-egress.outcome == 'success' }} env: E2E_JUNIT_FILE: ${{ github.workspace }}/_artifacts/helm-egress-credentials.xml run: hack/run-e2e-kind.sh ./internal/e2e/suites/egresscredinject -v -args --no-color --preview="${ATE_PREVIEW}" @@ -148,3 +163,13 @@ jobs: echo "=== logs: ate-system/${p} ===" kubectl --context kind-kind logs -n ate-system "$p" --all-containers --tail=300 || true done + # A container that restarted during the suite: its termination state and the log of the run that ended. + ended='{{range .items}}{{$p := .}}{{range $c := .status.containerStatuses}}{{with $c.lastState.terminated}}' + ended+='{{$p.metadata.namespace}} {{$p.metadata.name}} {{$c.name}} restarts={{$c.restartCount}}' + ended+=' reason={{.reason}} exitCode={{.exitCode}} finishedAt={{.finishedAt}}{{"\n"}}{{end}}{{end}}{{end}}' + kubectl --context kind-kind get pods -A -o go-template="${ended}" 2>/dev/null | + while read -r ns pod container rest; do + echo "=== previous logs: ${ns}/${pod} ${container} (${rest}) ===" + kubectl --context kind-kind logs -n "$ns" "$pod" -c "$container" --previous --tail=300 || true + done + kubectl --context kind-kind get events -A --field-selector type=Warning --sort-by=.lastTimestamp || true