-
Notifications
You must be signed in to change notification settings - Fork 35
Tests for filesystem and disk allocated size metrics #906
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?
Tests for filesystem and disk allocated size metrics #906
Conversation
Test for filesystem and disk allocated size metrics for windwos vms: kubevirt_vm_disk_allocated_size_bytes kubevirt_vmi_filesystem_used_bytes kubevirt_vmi_filesystem_capacity_bytes
## Walkthrough
This change refactors VM observability metrics tests and utilities by separating Linux and Windows test cases, updating and removing related fixtures, and introducing new utility functions for memory and storage metric validation. It enhances test clarity, improves metric validation robustness, and centralizes logic for retrieving and comparing VM metrics.
## Changes
| Files / Grouped Files | Change Summary |
|--------------------------------------------------------------|----------------|
| tests/observability/metrics/conftest.py | Removed unused imports and multiple VM memory/PodMetrics fixtures; renamed and split filesystem info fixtures for Linux and Windows; updated dependent fixture signatures; changed scope of Windows VM fixture. |
| tests/observability/metrics/test_vms_metrics.py | Refactored to separate Linux and Windows test classes for filesystem and disk size metrics; updated test method signatures; centralized free memory metric validation via a new helper function; replaced PVC size fixture with utility call. |
| tests/observability/metrics/utils.py | Refined regex and filtering in filesystem info; improved metric comparison logic with `math.isclose`; added functions for PVC size retrieval, pod requested memory, working set and RSS memory retrieval, and metric validation with tolerance and timeout. |
| tests/observability/metrics/constants.py | Added new constant `KUBEVIRT_VM_DISK_ALLOCATED_SIZE_BYTES` for VM disk allocated size metric template. |
## Possibly related PRs
- [RedHatQE/openshift-virtualization-tests#1023](https://github.com/RedHatQE/openshift-virtualization-tests/pull/1023): Modifies the `vm_memory_working_set_bytes` fixture with retry logic; directly related as this PR removes and replaces that fixture with new abstractions for VM free memory metric testing.
## Suggested labels
`verified`, `size/M`, `can-be-merged`, `lgtm-rnetser`, `approved-rnetser`, `lgtm-vsibirsk`, `lgtm-dshchedr`
## Suggested reviewers
- rnetser
- vsibirsk
- dshchedr
- hmeir
- RoniKishner 📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (3)
🚧 Files skipped from review as they are similar to previous changes (2)
🔇 Additional comments (10)
✨ Finishing Touches
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. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
Report bugs in Issues The following are automatically added:
Available user actions:
PR will be approved when the following conditions are met:
Approvers and Reviewers
Supported /retest check runs
Supported labels
|
/build-and-push-container |
New container for quay.io/openshift-cnv/openshift-virtualization-tests:pr-906 published |
/verified |
/approve |
Short description:
Test for filesystem and disk allocated size metrics for windwos vms:
kubevirt_vm_disk_allocated_size_bytes
kubevirt_vmi_filesystem_used_bytes
kubevirt_vmi_filesystem_capacity_bytes
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