OCPBUGS-66201: Add impersonation user tests for multi-group RBAC functionality
Description
Adding the e2e cypress test as a follow up for the multi-group impersonation feature completed in #15612
@Leo6Leo: This pull request references Jira Issue OCPBUGS-66201, which is invalid:
- expected the bug to target the "4.21.0" version, but no target version was set
Comment /jira refresh to re-evaluate validity if changes to the Jira bug are made, or edit the title of this pull request to link to a different bug.
The bug has been updated to refer to the pull request using the external bug tracker.
In response to this:
Description
Adding the e2e cypress test as a follow up for the multi-group impersonation feature completed in #15612
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.
Walkthrough
Adds two Cypress test files: a smoke test for impersonation modal and banner behavior, and a comprehensive E2E suite exercising multi-group impersonation and RBAC across namespaces with setup/teardown and helper utilities. (47 words)
Changes
| Cohort / File(s) | Summary |
|---|---|
Smoke test frontend/packages/integration-tests-cypress/tests/app/impersonate-user-smoke.cy.ts |
New Cypress smoke tests for impersonation modal: username input, start/stop impersonation flows, validation states, group UI behavior (mocked/real), and banner persistence across SPA navigation; includes cleanup to stop impersonation. |
Comprehensive E2E impersonation suite frontend/packages/integration-tests-cypress/tests/app/impersonate-user.cy.ts |
New extensive Cypress suite that creates namespaces/groups/GroupBindings and test pods, provides startImpersonation/stopImpersonation helpers, and covers single- and multi-group RBAC scenarios, group search/filter, selection mechanics, permission checks via oc commands, edge cases, and full setup/teardown. |
Estimated code review effort
🎯 4 (Complex) | ⏱️ ~60 minutes
- Pay special attention to:
- Setup/teardown: namespace, group, GroupBinding, and pod lifecycle and cleanup.
- Helper functions
startImpersonation/stopImpersonationand their UI selectors/state handling. - Use of
occommands and handling of non-zero exits or environment assumptions. - Mocking vs. real-group flows and tests that assert UI tooltip vs. banner rendering.
✨ Finishing touches
- [ ] 📝 Generate docstrings
🧪 Generate unit tests (beta)
- [ ] Create PR with unit tests
- [ ] Post copyable unit tests in a comment
Comment @coderabbitai help to get the list of available commands and usage tips.
/jira refresh
@Leo6Leo: This pull request references Jira Issue OCPBUGS-66201, which is valid. The bug has been moved to the POST state.
3 validation(s) were run on this bug
- bug is open, matching expected state (open)
- bug target version (4.21.0) matches configured target version for branch (4.21.0)
- bug is in the state ASSIGNED, which is one of the valid states (NEW, ASSIGNED, POST)
In response to this:
/jira refresh
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.
[APPROVALNOTIFIER] This PR is NOT APPROVED
This pull-request has been approved by: Leo6Leo Once this PR has been reviewed and has the lgtm label, please assign spadgett for approval. For more information see the Code Review Process.
The full list of commands accepted by this bot can be found here.
Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment
/retest-required
/retest-required
/retest-required This one should be flaky, since I ran the test locally it is passing fine.
/retest-required
@Leo6Leo: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:
| Test name | Commit | Details | Required | Rerun command |
|---|---|---|---|---|
| ci/prow/e2e-gcp-console | a8fa07ee8617fd6a85292dc61d607375a543d036 | link | true | /test e2e-gcp-console |
Full PR test history. Your PR dashboard.
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.