Add STD for vnic_info metric NAD swap test#4601
Add STD for vnic_info metric NAD swap test#4601OhadRevah wants to merge 1 commit intoRedHatQE:mainfrom
Conversation
📝 WalkthroughWalkthroughAdds a new parametrized test method to TestVmVnicInfo documenting a NAD-swap scenario for the ChangesTest Addition: vnic_info NAD-swap
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Warning Review ran into problems🔥 ProblemsTimed out fetching pipeline failures after 30000ms 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. Review rate limit: 0/1 reviews remaining, refill in 60 minutes.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
AI Features
💡 Tips
For more information, please refer to the project documentation or contact the maintainers. |
|
Clean rebase detected — no code changes compared to previous head ( |
|
D/S test |
|
D/S test |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@tests/observability/metrics/test_vms_metrics.py`:
- Around line 453-488: Move the STP traceability link out of the test and into
the module-level docstring at the top of the file, and simplify the test
docstring for test_metric_kubevirt_vm_vnic_info_after_nad_swap by removing the
"Parametrize:" section and leaving only "Preconditions:", "Steps:", and
"Expected:" entries; ensure the test stub (function
test_metric_kubevirt_vm_vnic_info_after_nad_swap) retains __test__ = False and
that the module docstring includes the required STP link for tests/** STD
coverage.
🪄 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: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: a6c00541-c936-4c6c-b925-24b9735d429f
📒 Files selected for processing (1)
tests/observability/metrics/test_vms_metrics.py
|
D/S test |
Add test stub with STD for verifying that kubevirt_vm_vnic_info and kubevirt_vmi_vnic_info Prometheus metrics update their network label after swapping a VM's secondary NAD reference. Parametrized for both metric variants. assisted by: claude code claude-opus-4-6 Signed-off-by: Ohad <orevah@redhat.com>
2ddee62 to
92a4f89
Compare
There was a problem hiding this comment.
♻️ Duplicate comments (1)
tests/observability/metrics/test_vms_metrics.py (1)
463-477:⚠️ Potential issue | 🟠 Major | ⚡ Quick winHIGH: Add the required module-level STP link for this new STD placeholder.
This stub follows the STD section format, but traceability is still incomplete because the module lacks an STP link in the module docstring. This rule exists to keep coverage mapping and STD-first review auditable.
Suggested fix
+"""STP: <link to the NAD reference live-update STP discussion>""" + import loggingAs per coding guidelines: “STP link REQUIRED in module docstring - every new feature test module MUST include an STP link for coverage tracking” and “STD docstrings must contain STP link directly in module docstring”.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@tests/observability/metrics/test_vms_metrics.py` around lines 463 - 477, The module is missing the required STP link in its top-level docstring; add a module-level STP reference string (e.g., "STP: <stp-id-or-url>") to the file's module docstring so the new test function test_metric_kubevirt_vm_vnic_info_after_nad_swap and other STD placeholders are traceable for coverage mapping and STD-first review; ensure the STP link is directly in the module docstring (not inside a function/class docstring) and follows the project's STP formatting convention.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Duplicate comments:
In `@tests/observability/metrics/test_vms_metrics.py`:
- Around line 463-477: The module is missing the required STP link in its
top-level docstring; add a module-level STP reference string (e.g., "STP:
<stp-id-or-url>") to the file's module docstring so the new test function
test_metric_kubevirt_vm_vnic_info_after_nad_swap and other STD placeholders are
traceable for coverage mapping and STD-first review; ensure the STP link is
directly in the module docstring (not inside a function/class docstring) and
follows the project's STP formatting convention.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: 202c9b79-c006-4099-a58e-4bc25b97a620
📒 Files selected for processing (1)
tests/observability/metrics/test_vms_metrics.py
|
D/S test |
| metric_name=f"kubevirt_vmi_vnic_info{{name='{windows_vm_for_test.name}'}}", | ||
| ) | ||
|
|
||
| @pytest.mark.parametrize( |
There was a problem hiding this comment.
|
/lgtm Reviewed the scenario - looks ok. |
Short description:
Add test stub with STD for verifying that
kubevirt_vm_vnic_info and kubevirt_vmi_vnic_info Prometheus metrics update their network label after swapping a VM's secondary NAD reference. Parametrized for both metric variants.
assisted by: claude code claude-opus-4-6
More details:
As part of NAD reference live-update STP
What this PR does / why we need it:
Which issue(s) this PR fixes:
Special notes for reviewer:
jira-ticket:
https://redhat.atlassian.net/browse/CNV-85546
Summary by CodeRabbit