CherryPicked: [cnv-4.21] fix: Handle same-name resources with different kinds in HCO related objects test#4133
Conversation
…bjects test (#4037) ##### Short description: The test_no_new_hco_related_objects comparison used a dict {name: kind}, which silently dropped entries when multiple resources shared the same name but had different kinds (e.g., Deployment and ServiceAccount for kubevirt-console-plugin). Switching to a set of (name, kind) tuples preserves all entries and correctly detects mismatches. Also adds the two new ServiceAccount entries (kubevirt-console-plugin, kubevirt-apiserver-proxy) introduced by HCO PR #3953 for security hardening. ##### More details: N/A ##### What this PR does / why we need it: N/A ##### Which issue(s) this PR fixes: N/A ##### Special notes for reviewer: N/A ##### jira-ticket: https://issues.redhat.com/browse/CNV-81032 <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Tests** * Updated validation logic for related object comparisons to improve accuracy and clarity. * **Chores** * Updated resource mappings to properly track ServiceAccount resources for KubeVirt components. <!-- end of auto-generated comment: release notes by coderabbit.ai --> Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. 🗂️ Base branches to auto review (4)
Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Tip Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs). 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 |
|
Report bugs in Issues Welcome! 🎉This pull request will be automatically processed with the following features:
🔄 Automatic Actions
📋 Available CommandsPR Status Management
Review & Approval
Testing & Validation
Container Operations
Cherry-pick Operations
Label Management
✅ Merge RequirementsThis PR will be automatically approved when the following conditions are met:
📊 Review ProcessApprovers and ReviewersApprovers:
Reviewers:
Available Labels
💡 Tips
For more information, please refer to the project documentation or contact the maintainers. |
|
/lgtm |
|
/approve |
|
/retest build-container |
|
/build-and-push-container |
|
New container for quay.io/openshift-cnv/openshift-virtualization-tests:pr-4133 published |
|
/verified |
Test execution plan request detailsCRITICAL: You MUST post an inline review comment on the first changed line of the first file. As an expert software testing engineer, analyze all modified files in this PR and create a targeted test execution plan. Analysis Requirements:
Your deliverable: Test Execution Plan
Guidelines:
Hardware-Related Checks (SR-IOV, GPU, DPDK): When PR modifies fixtures for hardware-specific resources:
CRITICAL WORKFLOW COMPLETION RULES: When responding to this test execution plan request, you MUST follow these rules EXACTLY:
ABSOLUTE PROHIBITIONS (violating these creates empty/meaningless reviews):
Remember: The pull request review is visible to users. Additional comments are redundant noise. CRITICAL: Before setting "Run smoke tests: True", you MUST use shell scripts to: |
| @@ -1,5 +1,4 @@ | |||
| import pytest | |||
There was a problem hiding this comment.
Test Execution Plan
-
Run smoke tests: False
-
tests/install_upgrade_operators/strict_reconciliation/test_hco_related_objects.py::TestRelatedObjects::test_no_new_hco_related_objects -
tests/install_upgrade_operators/strict_reconciliation/test_hco_related_objects.py::TestRelatedObjects::test_hco_related_objects
|
Tip For best results, initiate chat on the files or code changes. 🧩 Analysis chain🏁 Script executed: Length of output: 2938 🏁 Script executed: Length of output: 535 🏁 Script executed: Length of output: 1260 🏁 Script executed: Length of output: 1736 🧠 Learnings used |
Cherry-pick from
mainbranch, original PR: #4037, PR owner: rlobillo