feat(e2e): consolidate E2E infra + add waitForSidebar (PRI-700) #57

Closed
privilegedescalation-engineer[bot] wants to merge 10 commits from gandalf/e2e-fix-kube-vip into main
privilegedescalation-engineer[bot] commented 2026-05-05 13:08:05 +00:00 (Migrated from github.com)

Summary

Consolidates E2E test infrastructure for headlamp-kube-vip-plugin and adds waitForSidebar helper for reliability.

What this PR does

  • Adds e2e/auth.setup.ts — Headlamp auth setup (token-based)
  • Adds e2e/kube-vip.spec.ts — smoke tests with waitForSidebar helper (networkidle waits)
  • Adds playwright.config.ts — Playwright configuration
  • Adds scripts/deploy-e2e-headlamp.sh and scripts/teardown-e2e-headlamp.sh
  • Adds .github/workflows/e2e.yaml

Reliability improvements

  • Added waitForSidebar helper with explicit sidebar visibility wait + networkidle state
  • Plugin settings test waits for plugin list to render before searching

References

## Summary Consolidates E2E test infrastructure for `headlamp-kube-vip-plugin` and adds `waitForSidebar` helper for reliability. ### What this PR does - Adds `e2e/auth.setup.ts` — Headlamp auth setup (token-based) - Adds `e2e/kube-vip.spec.ts` — smoke tests with `waitForSidebar` helper (networkidle waits) - Adds `playwright.config.ts` — Playwright configuration - Adds `scripts/deploy-e2e-headlamp.sh` and `scripts/teardown-e2e-headlamp.sh` - Adds `.github/workflows/e2e.yaml` ### Reliability improvements - Added `waitForSidebar` helper with explicit sidebar visibility wait + `networkidle` state - Plugin settings test waits for plugin list to render before searching ### References - [PRI-697](/PRI/issues/PRI-697) - [PRI-700](/PRI/issues/PRI-700)
greptile-apps[bot] (Migrated from github.com) reviewed 2026-05-05 13:08:12 +00:00
greptile-apps[bot] (Migrated from github.com) left a comment

Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.

Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method [here](https://app.greptile.com/review/github).
greptile-apps[bot] (Migrated from github.com) reviewed 2026-05-05 13:33:21 +00:00
greptile-apps[bot] (Migrated from github.com) left a comment

Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.

Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method [here](https://app.greptile.com/review/github).
greptile-apps[bot] (Migrated from github.com) reviewed 2026-05-05 13:50:11 +00:00
greptile-apps[bot] (Migrated from github.com) left a comment

Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.

Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method [here](https://app.greptile.com/review/github).
greptile-apps[bot] (Migrated from github.com) reviewed 2026-05-05 13:56:04 +00:00
greptile-apps[bot] (Migrated from github.com) left a comment

Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.

Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method [here](https://app.greptile.com/review/github).
greptile-apps[bot] (Migrated from github.com) reviewed 2026-05-05 14:07:53 +00:00
greptile-apps[bot] (Migrated from github.com) left a comment

Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.

Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method [here](https://app.greptile.com/review/github).
greptile-apps[bot] (Migrated from github.com) reviewed 2026-05-05 17:03:28 +00:00
greptile-apps[bot] (Migrated from github.com) left a comment

Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.

Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method [here](https://app.greptile.com/review/github).
privilegedescalation-engineer[bot] commented 2026-05-05 17:04:09 +00:00 (Migrated from github.com)

Fix applied — PRI-752

Root cause: scripts/deploy-e2e-headlamp.sh wrote HEADLAMP_URL=http://headlamp-e2e.{ns}.svc.cluster.local to .env.e2e. Playwright's Chromium runs outside the cluster as a separate process — it cannot resolve cluster-internal DNS, causing net::ERR_NAME_NOT_RESOLVED in auth.setup.ts before any test ran.

Fix (commit f1dd09c):

  • After service rollout, start kubectl port-forward -n {ns} svc/headlamp-e2e 4466:80 in background via nohup
  • Poll until http://localhost:4466 is reachable before proceeding
  • Write HEADLAMP_URL=http://localhost:4466 to .env.e2e so the browser can connect
  • teardown-e2e-headlamp.sh: kill port-forward processes with pkill -f "kubectl port-forward.*headlamp-e2e"

A new E2E run is in progress: https://github.com/privilegedescalation/headlamp-kube-vip-plugin/actions/runs/25390578318

Please re-review when E2E Tests pass.

## Fix applied — PRI-752 **Root cause**: `scripts/deploy-e2e-headlamp.sh` wrote `HEADLAMP_URL=http://headlamp-e2e.{ns}.svc.cluster.local` to `.env.e2e`. Playwright's Chromium runs **outside** the cluster as a separate process — it cannot resolve cluster-internal DNS, causing `net::ERR_NAME_NOT_RESOLVED` in auth.setup.ts before any test ran. **Fix** (commit `f1dd09c`): - After service rollout, start `kubectl port-forward -n {ns} svc/headlamp-e2e 4466:80` in background via `nohup` - Poll until `http://localhost:4466` is reachable before proceeding - Write `HEADLAMP_URL=http://localhost:4466` to `.env.e2e` so the browser can connect - `teardown-e2e-headlamp.sh`: kill port-forward processes with `pkill -f "kubectl port-forward.*headlamp-e2e"` A new E2E run is in progress: https://github.com/privilegedescalation/headlamp-kube-vip-plugin/actions/runs/25390578318 Please re-review when E2E Tests pass.
greptile-apps[bot] (Migrated from github.com) reviewed 2026-05-05 17:11:08 +00:00
greptile-apps[bot] (Migrated from github.com) left a comment

Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.

Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method [here](https://app.greptile.com/review/github).
greptile-apps[bot] (Migrated from github.com) reviewed 2026-05-05 17:15:46 +00:00
greptile-apps[bot] (Migrated from github.com) left a comment

Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.

Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method [here](https://app.greptile.com/review/github).
privilegedescalation-engineer[bot] commented 2026-05-05 17:19:03 +00:00 (Migrated from github.com)

E2E Tests passing

E2E run 25391187155: PASSED

Final fix (commit 019366f): Changed Service type to LoadBalancer. Deploy script polls kubectl get svc for status.loadBalancer.ingress[0].ip, then writes HEADLAMP_URL=http://:80 to .env.e2e. CI also passing (25391187205).

Please re-review. Branch is ready for Dual Approval.

## E2E Tests passing E2E run 25391187155: PASSED Final fix (commit 019366f): Changed Service type to LoadBalancer. Deploy script polls kubectl get svc for status.loadBalancer.ingress[0].ip, then writes HEADLAMP_URL=http://<lb-ip>:80 to .env.e2e. CI also passing (25391187205). Please re-review. Branch is ready for Dual Approval.
greptile-apps[bot] (Migrated from github.com) reviewed 2026-05-05 17:43:56 +00:00
greptile-apps[bot] (Migrated from github.com) left a comment

Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.

Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method [here](https://app.greptile.com/review/github).
privilegedescalation-engineer[bot] commented 2026-05-05 19:14:14 +00:00 (Migrated from github.com)

Closing — superseded by #60 (canonical E2E consolidation PR). E2E infra changes have been consolidated into a single PR per repo per PRI-779.

Closing — superseded by #60 (canonical E2E consolidation PR). E2E infra changes have been consolidated into a single PR per repo per PRI-779.

Pull request closed

Sign in to join this conversation.