🧪 Add e2e tests for Namespcae admin migration with multiple CRBs, CRD, and limited RBAC export - #663
🧪 Add e2e tests for Namespcae admin migration with multiple CRBs, CRD, and limited RBAC export#663RanWurmbrand wants to merge 2 commits into
Conversation
|
Warning Review limit reached
Next review available in: 29 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughCrane export and apply runners now support ChangesSplit-apply migration workflows
Estimated code review effort: 4 (Complex) | ~45 minutes Possibly related PRs
Suggested labels: Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Test Coverage ReportTotal: 48.3% Per-package coverage
Full function-level detailsPosted by CI |
424d68e to
a5c49c0
Compare
There was a problem hiding this comment.
Actionable comments posted: 3
🧹 Nitpick comments (1)
e2e-tests/tests/tier0/mta_872_crd_split_apply_test.go (1)
61-64: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueKeep error checks adjacent to their assignments.
Moving the
Expect(err)check immediately after theNewScenarioPathsassignment improves readability and prevents logic errors before the error is checked.♻️ Proposed refactor
paths, err := NewScenarioPaths("crane-*") + Expect(err).NotTo(HaveOccurred()) runner := scenario.Crane - Expect(err).NotTo(HaveOccurred())🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@e2e-tests/tests/tier0/mta_872_crd_split_apply_test.go` around lines 61 - 64, Move the Expect(err).NotTo(HaveOccurred()) assertion directly after the NewScenarioPaths("crane-*") assignment, before initializing runner with scenario.Crane, while preserving the existing error-check behavior.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@e2e-tests/tests/tier0/mta_871_multiple_crbs_split_apply_test.go`:
- Line 15: Correct the Ginkgo label in the test declaration for “[NA-2]Should
migrate workload with one CR and two CRBs using split apply” from the malformed
tier label to “tier0”, preserving the rest of the test definition unchanged.
In `@e2e-tests/tests/tier0/mta_872_crd_split_apply_test.go`:
- Around line 27-32: Remove the empty-context Skip guards for
scenario.KubectlSrcNonAdmin.Context and scenario.KubectlTgtNonAdmin.Context in
the non-admin role migration test setup. Allow the RUN_AS_ADMIN override to
control execution without skipping when either context is empty.
- Around line 106-112: Update the AssertResourcesExist path in the CRD export
verification to use resources/_cluster directly, removing the namespace
component. Keep the existing CRD match and assertions unchanged.
---
Nitpick comments:
In `@e2e-tests/tests/tier0/mta_872_crd_split_apply_test.go`:
- Around line 61-64: Move the Expect(err).NotTo(HaveOccurred()) assertion
directly after the NewScenarioPaths("crane-*") assignment, before initializing
runner with scenario.Crane, while preserving the existing error-check behavior.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: dc44979d-2247-45e4-878f-e0f5dae6bb34
📒 Files selected for processing (5)
e2e-tests/framework/crane.goe2e-tests/tests/tier0/mta_871_multiple_crbs_split_apply_test.goe2e-tests/tests/tier0/mta_872_crd_split_apply_test.goe2e-tests/tests/tier1/mta_873_limited_rbac_export_test.goe2e-tests/utils/utils.go
a5c49c0 to
95913f6
Compare
|
tested and passed on ocp |
nachandr
left a comment
There was a problem hiding this comment.
I've left a few minor comments.
|
…limited RBAC export Signed-off-by: Ran Wurmbrand <rwurmbra@redhat.com>
b8aaa2d to
a0488d7
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@e2e-tests/utils/utils.go`:
- Around line 1303-1305: Update the early-return condition in the
resource-checking function around existingFiles so it only returns on err !=
nil, removing the len(existingFiles) == 0 check. Let empty directories continue
through the resource loop to produce the existing descriptive missing-resource
error, while allowing an empty resources collection to return true, nil.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: e37b4369-c8c6-4683-b454-d1089dbc326f
📒 Files selected for processing (5)
e2e-tests/framework/crane.goe2e-tests/tests/tier0/mta_871_multiple_crbs_split_apply_test.goe2e-tests/tests/tier0/mta_872_crd_split_apply_test.goe2e-tests/tests/tier1/mta_873_limited_rbac_export_test.goe2e-tests/utils/utils.go
🚧 Files skipped from review as they are similar to previous changes (4)
- e2e-tests/tests/tier1/mta_873_limited_rbac_export_test.go
- e2e-tests/framework/crane.go
- e2e-tests/tests/tier0/mta_872_crd_split_apply_test.go
- e2e-tests/tests/tier0/mta_871_multiple_crbs_split_apply_test.go
Signed-off-by: Ran Wurmbrand <rwurmbra@redhat.com>
a0488d7 to
546c5a1
Compare
closes: #664
*** should be merged after #646
Summary
Add e2e tests for namespace-admin split-apply migration covering multiple CRBs, CRD lifecycle, and limited RBAC export.
Changes
vent kind-prefix collisions
Test plan
ginkgo run -v -r --focus="MTA-871" e2e-tests/testsginkgo run -v -r --focus="MTA-872" e2e-tests/testsginkgo run -v -r --focus="MTA-873" e2e-tests/testsgo test ./e2e-tests/utils -vSummary by CodeRabbit
Summary
New Features
--overwriteflag to replace existing resources when enabled.Tests
Utilities