Remove CNV-76682 and last_over_time query#4481
Conversation
📝 WalkthroughWalkthroughAdded a function-scoped VM migration fixture, shortened metric polling interval, and simplified a Prometheus metric lookup in a test by removing unused imports and elapsed-time calculation; also removed a Jira test marker. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes 🚥 Pre-merge checks | ✅ 1 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (1 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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
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. |
|
/build-and-push-container |
|
Clean rebase detected — no code changes compared to previous head ( |
|
New container for quay.io/openshift-cnv/openshift-virtualization-tests:pr-4481 published |
|
/lgtm |
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: |
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
tests/observability/metrics/test_migration_metrics.py (1)
44-54:⚠️ Potential issue | 🟠 MajorHIGH — Use
@pytest.mark.usefixturesforvm_migration_metrics_vmim_scope_function.The test doesn't consume the fixture's return value (Ruff ARG002 correctly flags it), it only needs the side effect of creating the VMIM and waiting for RUNNING. As per coding guidelines: "ALWAYS use
@pytest.mark.usefixtureswhen fixture return value is not used by test". This keeps the signature honest about which fixtures provide data vs. pure setup.Proposed diff
`@pytest.mark.s390x` + `@pytest.mark.usefixtures`("vm_migration_metrics_vmim_scope_function") def test_kubevirt_vmi_migration_metrics( self, prometheus, namespace, admin_client, migration_policy_with_bandwidth_scope_class, vm_for_migration_metrics_test, - vm_migration_metrics_vmim_scope_function, query, ):As per coding guidelines: "ALWAYS use
@pytest.mark.usefixtureswhen fixture return value is not used by test".🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@tests/observability/metrics/test_migration_metrics.py` around lines 44 - 54, The test test_kubevirt_vmi_migration_metrics currently accepts the fixture vm_migration_metrics_vmim_scope_function as a parameter but does not use its return value; change this to a pure setup fixture by removing vm_migration_metrics_vmim_scope_function from the test signature and adding `@pytest.mark.usefixtures`("vm_migration_metrics_vmim_scope_function") above the test (keep the existing `@pytest.mark.s390x` marker), so the VMIM side-effects run without implying the test consumes a return value.
🤖 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/conftest.py`:
- Around line 498-507: Extract the duplicated VMIM creation into a helper (e.g.,
create_vmim_for_migration_metrics) in tests/observability/metrics/utils.py that
encapsulates constructing
VirtualMachineInstanceMigration(name="vm-migration-metrics-vmim",
namespace=vm_for_migration_metrics_test.namespace,
vmi_name=vm_for_migration_metrics_test.vmi.name, client=admin_client), calling
vmim.wait_for_status(status=vmim.Status.RUNNING, timeout=TIMEOUT_3MIN), and
returning or yielding the ready vmim; then have both fixtures
vm_migration_metrics_vmim_scope_function and
vm_migration_metrics_vmim_scope_class call that helper to remove duplicated
body. Also add a short comment or parameter to the helper about the fixed
resource name "vm-migration-metrics-vmim" to avoid accidental name collisions if
both fixtures are used in the same test run.
---
Outside diff comments:
In `@tests/observability/metrics/test_migration_metrics.py`:
- Around line 44-54: The test test_kubevirt_vmi_migration_metrics currently
accepts the fixture vm_migration_metrics_vmim_scope_function as a parameter but
does not use its return value; change this to a pure setup fixture by removing
vm_migration_metrics_vmim_scope_function from the test signature and adding
`@pytest.mark.usefixtures`("vm_migration_metrics_vmim_scope_function") above the
test (keep the existing `@pytest.mark.s390x` marker), so the VMIM side-effects run
without implying the test consumes a return value.
🪄 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: cfbde6a3-3537-44bf-a3f0-9d9d670a36e9
📒 Files selected for processing (3)
tests/observability/metrics/conftest.pytests/observability/metrics/test_migration_metrics.pytests/observability/metrics/utils.py
|
Tip For best results, initiate chat on the files or code changes. 🧩 Analysis chain🏁 Script executed: Length of output: 3027 🏁 Script executed: Length of output: 1786 🧠 Learnings used |
|
/lgtm |
|
/lgtm |
|
/approve |
1 similar comment
|
/approve |
|
Successfully removed PR tag: quay.io/openshift-cnv/openshift-virtualization-tests:pr-4481. |
|
New container for quay.io/openshift-cnv/openshift-virtualization-tests:latest published |
Short description:
The bug is fixed, remove the jira marker with the bug and last_over_time query for metric, instead the sampler will query every 5 seconds and not 30 to catch.
More details:
What this PR does / why we need it:
Which issue(s) this PR fixes:
Special notes for reviewer:
jira-ticket:
Summary by CodeRabbit
Tests
Chores