-
Notifications
You must be signed in to change notification settings - Fork 48
change string to constants in vm_for_console_proxy #1973
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Roni Kishner <[email protected]>
WalkthroughReplaced hardcoded instance type and preference strings in a test fixture with shared constants. Updated imports to include new constants. Introduced two new public constants in utilities.constants. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested labels
Suggested reviewers
✨ Finishing Touches
🧪 Generate unit tests
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
CodeRabbit Configuration File (
|
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. |
/verified |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
tests/infrastructure/vm_console_proxy/conftest.py (1)
97-99
: Optional: preflight-check that Instancetype/Preference exist to fail fast with a clear message.This fixture assumes cluster-scoped resources exist. A lightweight assert improves debuggability when environments drift.
Apply this diff to pass validated handles:
- vm_instance_type=VirtualMachineClusterInstancetype(name=U1_SMALL), - vm_preference=VirtualMachineClusterPreference(name=RHEL10_PREFERENCE), + vm_instance_type=instancetype, + vm_preference=preference,And insert just above the
with VirtualMachineForTests(...):
instancetype = VirtualMachineClusterInstancetype(name=U1_SMALL) preference = VirtualMachineClusterPreference(name=RHEL10_PREFERENCE) assert instancetype.exists, f"ClusterInstancetype '{U1_SMALL}' not found" assert preference.exists, f"ClusterPreference '{RHEL10_PREFERENCE}' not found"
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (1)
tests/infrastructure/vm_console_proxy/conftest.py
(2 hunks)
🧰 Additional context used
🧠 Learnings (2)
📚 Learning: 2025-06-18T09:21:34.315Z
Learnt from: OhadRevah
PR: RedHatQE/openshift-virtualization-tests#1166
File: tests/observability/metrics/conftest.py:1065-1077
Timestamp: 2025-06-18T09:21:34.315Z
Learning: In tests/observability/metrics/conftest.py, when creating fixtures that modify shared Windows VM state (like changing nodeSelector), prefer using function scope rather than class scope to ensure ResourceEditor context managers properly restore the VM state after each test, maintaining test isolation while still reusing expensive Windows VM fixtures.
Applied to files:
tests/infrastructure/vm_console_proxy/conftest.py
📚 Learning: 2025-06-18T09:19:05.769Z
Learnt from: OhadRevah
PR: RedHatQE/openshift-virtualization-tests#1166
File: tests/observability/metrics/test_vms_metrics.py:129-137
Timestamp: 2025-06-18T09:19:05.769Z
Learning: For Windows VM testing in tests/observability/metrics/test_vms_metrics.py, it's acceptable to have more fixture parameters than typical pylint recommendations when reusing expensive Windows VM fixtures for performance. Windows VMs take a long time to deploy, so reusing fixtures like windows_vm_for_test and adding labels via windows_vm_with_low_bandwidth_migration_policy is preferred over creating separate fixtures that would require additional VM deployments.
Applied to files:
tests/infrastructure/vm_console_proxy/conftest.py
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (5)
- GitHub Check: can-be-merged
- GitHub Check: build-container
- GitHub Check: tox
- GitHub Check: can-be-merged
- GitHub Check: can-be-merged
🔇 Additional comments (1)
tests/infrastructure/vm_console_proxy/conftest.py (1)
33-33
: LGTM: Shared constants validated
RHEL10_PREFERENCE and U1_SMALL are defined in utilities/constants.py, and no hardcoded"rhel.10"
or"u1.small"
literals remain.
/approve |
Short description:
change string to constants in vm_for_console_proxy
What this PR does / why we need it:
Use new constants
jira-ticket:
https://issues.redhat.com/browse/CNV-65113
Summary by CodeRabbit
Tests
Chores