Obs metrics nad swap vnic info#5222
Conversation
These modules have no dependency on test-specific code. Moving them to libs/net/ makes them importable from any test suite without cross-package imports. Assisted-by: Claude Sonnet 4.6 <noreply@anthropic.com> Signed-off-by: Asia Khromov <azhivovk@redhat.com>
Add cluster_vlan_iterator() to libs/net/cluster.py. The underlying VLAN list is read from py_config once via a cached helper; each call returns a fresh generator so every fixture invocation starts from the beginning. Add next_vlan_index_number fixture to tests/conftest.py using this helper so any test suite can allocate cluster VLANs without cross-package imports. Network tests continue to use their own fixture in tests/network/conftest.py and will be adjusted in a follow-up. Assisted-by: Claude Sonnet 4.6 <noreply@anthropic.com> Signed-off-by: Asia Khromov <azhivovk@redhat.com>
Wait condition helpers use vm.vmi which exists on both BaseVirtualMachine and VirtualMachineForTests. Widen the type to VirtualMachine so any subclass can be passed without a type error. Assisted-by: Claude Sonnet 4.6 <noreply@anthropic.com> Signed-off-by: Asia Khromov <azhivovk@redhat.com>
Implement test_metric_kubevirt_vm_vnic_info_after_nad_swap to verify that kubevirt_vm_vnic_info and kubevirt_vmi_vnic_info metric labels update correctly after swapping the VM secondary network NAD reference and completing the triggered live migration. Signed-off-by: Ohad <orevah@redhat.com> Assisted-by: claude code claude-opus-4-6
- Use BaseVirtualMachine via base_vmspec/fedora_vm for vm_for_nad_swap_test - Reuse update_nad_references from tests/utils.py in post_nad_swap_vm - Fix validate_vnic_info to poll until metric matches expected values instead of breaking on the first (possibly stale) result - Fix import style per AGENTS.md (from libs.net import ... as libnncp) - Restore original STD steps in test docstring Signed-off-by: Ohad <orevah@redhat.com> Assisted-by: claude code claude-opus-4-6
Move update_nad_references to libs/net/vmspec.py to eliminate identical copies in tests/utils.py and tests/network/l2_bridge/nad_ref_change/lib_helpers.py. The function is used by both network and observability team directories, so it belongs in a shared module per project conventions. assisted by: claude code claude-opus-4-6 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Signed-off-by: Ohad <orevah@redhat.com>
Signed-off-by: Ohad <orevah@redhat.com>
Move update_nad_references to libs/net/vmspec.py to eliminate identical copies in tests/utils.py, tests/network/l2_bridge/nad_ref_change/lib_helpers.py, and tests/network/libs/nad_ref.py. The function is used across network and observability team directories, so it belongs in a shared module. Also adds fail-fast validation: raises ValueError for missing networks, non-Multus networks, and unmatched interface names. assisted by: claude code claude-opus-4-6 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Signed-off-by: Ohad <orevah@redhat.com>
Qodo reviews are paused for this user.Troubleshooting steps vary by plan Learn more → On a Teams plan? Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center? |
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (23)
📝 WalkthroughWalkthroughHelpers previously scattered across ChangesPromote helpers to libs.net and wire NAD-swap observability test
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested reviewers
✨ 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 |
|
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
Branch Management
Label Management
✅ Merge RequirementsThis PR will be automatically approved when the following conditions are met:
📊 Review ProcessApprovers and ReviewersApprovers:
Reviewers:
Available Labels
AI Features
Security Checks
💡 Tips
For more information, please refer to the project documentation or contact the maintainers. |
What this PR does / why we need it:
Which issue(s) this PR fixes:
Special notes for reviewer:
jira-ticket:
Summary by CodeRabbit
New Features
Improvements