diff --git a/e2e/auth.setup.ts b/e2e/auth.setup.ts index 2bc6d1d..2b4ecb9 100644 --- a/e2e/auth.setup.ts +++ b/e2e/auth.setup.ts @@ -45,8 +45,12 @@ async function authenticateWithToken(page: Page, token: string): Promise { await page.waitForURL(/\/(login|token)$/); if (page.url().includes('/login')) { - // OIDC login page — click "use a token" to reach token auth - await page.getByRole('button', { name: /use a token/i }).click(); + // OIDC login page — click "use a token" to reach token auth. + // Wait explicitly before clicking so failures surface at 15 s + // with a clear message rather than silently timing out at 60 s. + const useTokenBtn = page.getByRole('button', { name: /use a token/i }); + await useTokenBtn.waitFor({ state: 'visible', timeout: 15_000 }); + await useTokenBtn.click(); await page.waitForURL('**/token'); } diff --git a/scripts/deploy-e2e-headlamp.sh b/scripts/deploy-e2e-headlamp.sh index 6186d5a..1b19583 100755 --- a/scripts/deploy-e2e-headlamp.sh +++ b/scripts/deploy-e2e-headlamp.sh @@ -58,6 +58,16 @@ kubectl create configmap headlamp-polaris-plugin \ --from-file="$DIST_DIR" \ --from-file=package.json="$REPO_ROOT/package.json" +# --- Tear down any existing E2E deployment for a clean start --- +# kubectl apply without prior deletion only patches in-place: if the pod spec is +# unchanged between runs, no new rollout is triggered and a degraded pod keeps +# serving. Delete first to guarantee a fresh pod regardless of prior state. +echo "" +echo "Removing any existing E2E deployment (clean-start)..." +kubectl delete deployment "${E2E_RELEASE}" -n "$E2E_NAMESPACE" --ignore-not-found --wait +kubectl delete service "${E2E_RELEASE}" -n "$E2E_NAMESPACE" --ignore-not-found --wait +kubectl delete serviceaccount "${E2E_RELEASE}" -n "$E2E_NAMESPACE" --ignore-not-found --wait + # --- Deploy Headlamp via kubectl apply --- echo "" echo "Deploying Headlamp E2E instance..."