fix(e2e): write HEADLAMP_URL before token gen; add pods RBAC (PRI-879) #68

Closed
privilegedescalation-engineer[bot] wants to merge 3 commits from gandalf/fix-e2e-pri-879 into main

3 Commits

Author SHA1 Message Date
Chris Farhood fe69dee84e fix e2e: use button role for storage classes sidebar selector
The storage classes sidebar entry is rendered as a button, not a link.
Fix the flaky E2E test by changing getByRole('link') to getByRole('button').

Fixes PRI-935

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-05-06 17:11:07 +00:00
Chris Farhood 215c79ae19 fix(e2e): write HEADLAMP_URL before token gen; add pods RBAC
Fix two bugs from PRI-879 QA review:

- HEADLAMP_URL is now written to .env.e2e unconditionally, before
  attempting token generation. Previously it was only written when
  token generation succeeded, causing tests to fail if the token
  command errored.

- ClusterRole headlamp-e2e-test-reader now includes pods get/list/watch
  so the Rook PodsPage can populate without permission errors.

Does not address the popup race in auth.setup.ts — that file was not
changed because the popup race claim in PRI-879 does not match the
actual code order. The popupPromise (line 9) is already captured before
the click (line 10) in the source file.

Fixes: PRI-879

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-05-06 13:33:41 +00:00
Chris Farhood 169d2ec91b fix(e2e): add cluster-scoped RBAC for E2E service account
The headlamp-e2e-test service account needs cluster-wide read permissions
for storageclasses, cephclusters, persistentvolumes, and
persistentvolumeclaims so the Rook plugin sidebar can populate these
resources without errors.

- Add ClusterRole headlamp-e2e-test-reader with get/list/watch on
  storageclasses, cephclusters, cephclusters/status, persistentvolumes,
  persistentvolumeclaims
- Add ClusterRoleBinding headlamp-e2e-test-crb binding the role to
  the headlamp-e2e-test service account
- Update teardown to also clean up the ClusterRole and ClusterRoleBinding

Fixes: PRI-741

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-05-05 16:12:03 +00:00