From 29bc9535222c5a3374e648f6d80ac6d3299ea5f5 Mon Sep 17 00:00:00 2001 From: "hugh-hackman[bot]" <266376744+hugh-hackman[bot]@users.noreply.github.com> Date: Sun, 8 Mar 2026 21:07:46 -0400 Subject: [PATCH] ci: add E2E preflight check for Headlamp connectivity and plugin version (#24) Adds a diagnostic step before E2E tests that: - Logs the expected plugin version from package.json - Verifies Headlamp is reachable (fails fast if not) - Attempts to list installed plugins for debugging This surfaces version mismatches and connectivity issues immediately instead of requiring analysis of cryptic test timeout failures. Co-authored-by: gandalf-the-greybeard[bot] Co-authored-by: Claude Opus 4.6 --- .github/workflows/e2e.yaml | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/.github/workflows/e2e.yaml b/.github/workflows/e2e.yaml index abce37b..2c72a3c 100644 --- a/.github/workflows/e2e.yaml +++ b/.github/workflows/e2e.yaml @@ -25,6 +25,36 @@ jobs: - name: Install dependencies run: npm ci + - name: Preflight — verify Headlamp connectivity + env: + HEADLAMP_URL: ${{ secrets.HEADLAMP_URL || 'http://headlamp.kube-system.svc.cluster.local' }} + run: | + echo "::group::Expected plugin version" + EXPECTED=$(node -p "require('./package.json').version") + echo "Plugin version in repo: $EXPECTED" + echo "::endgroup::" + + echo "::group::Headlamp connectivity" + HTTP_CODE=$(curl -s -o /dev/null -w '%{http_code}' --connect-timeout 10 "$HEADLAMP_URL" || true) + if [ "$HTTP_CODE" = "000" ]; then + echo "::error::Cannot reach Headlamp at $HEADLAMP_URL — E2E tests will fail" + exit 1 + fi + echo "Headlamp responded with HTTP $HTTP_CODE at $HEADLAMP_URL" + echo "::endgroup::" + + echo "::group::Installed plugins" + # Headlamp serves plugin metadata at /plugins — no auth required + curl -sf --connect-timeout 10 "$HEADLAMP_URL/plugins" 2>/dev/null \ + | node -e " + const d = require('fs').readFileSync(0,'utf8'); + try { + const plugins = JSON.parse(d); + for (const p of plugins) console.log(' ' + p.name + '@' + (p.version||'unknown')); + } catch { console.log(' (could not parse plugin list)'); } + " || echo " (plugin list endpoint not available — tests will validate at runtime)" + echo "::endgroup::" + - name: Install Playwright browsers run: npx playwright install --with-deps chromium