Adapt test_metric_kubevirt_vm_disk_allocated_size_bytes to filesystem storageClass#4350
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (2)
📜 Recent review details🧰 Additional context used📓 Path-based instructions (5)**/*.py📄 CodeRabbit inference engine (AGENTS.md)
Files:
tests/**/test_*.py📄 CodeRabbit inference engine (AGENTS.md)
Files:
tests/**/*.py📄 CodeRabbit inference engine (AGENTS.md)
Files:
**/test_*.py📄 CodeRabbit inference engine (Custom checks)
Files:
**⚙️ CodeRabbit configuration file
Files:
🧠 Learnings (64)📚 Learning: 2025-12-15T12:33:06.686ZApplied to files:
📚 Learning: 2026-01-14T04:08:23.032ZApplied to files:
📚 Learning: 2026-01-18T09:44:17.044ZApplied to files:
📚 Learning: 2026-01-27T17:18:49.973ZApplied to files:
📚 Learning: 2026-02-23T16:31:34.505ZApplied to files:
📚 Learning: 2026-02-25T10:52:09.679ZApplied to files:
📚 Learning: 2026-03-19T10:36:59.023ZApplied to files:
📚 Learning: 2026-03-25T11:24:07.687ZApplied to files:
📚 Learning: 2026-03-31T08:35:22.802ZApplied to files:
📚 Learning: 2026-03-31T10:39:33.409ZApplied to files:
📚 Learning: 2026-04-02T09:03:57.004ZApplied to files:
📚 Learning: 2026-04-14T13:00:57.514ZApplied to files:
📚 Learning: 2026-04-14T16:15:31.065ZApplied to files:
📚 Learning: 2026-04-14T16:15:33.012ZApplied to files:
📚 Learning: 2026-04-21T19:08:39.771ZApplied to files:
📚 Learning: 2026-04-26T11:44:20.150ZApplied to files:
📚 Learning: 2026-04-27T15:40:31.167ZApplied to files:
📚 Learning: 2026-05-03T14:47:13.096ZApplied to files:
📚 Learning: 2026-05-05T17:27:32.109ZApplied to files:
📚 Learning: 2026-05-05T18:28:01.097ZApplied to files:
📚 Learning: 2026-05-07T12:34:42.589ZApplied to files:
📚 Learning: 2026-05-08T12:31:26.895ZApplied to files:
📚 Learning: 2026-05-12T18:18:20.607ZApplied to files:
📚 Learning: 2026-05-25T09:13:27.011ZApplied to files:
📚 Learning: 2026-05-25T09:57:03.042ZApplied to files:
📚 Learning: 2026-05-28T12:55:07.435ZApplied to files:
📚 Learning: 2026-05-29T07:28:31.170ZApplied to files:
📚 Learning: 2025-12-22T16:27:40.244ZApplied to files:
📚 Learning: 2026-01-07T09:52:12.342ZApplied to files:
📚 Learning: 2026-01-18T13:18:48.808ZApplied to files:
📚 Learning: 2026-01-18T14:51:50.846ZApplied to files:
📚 Learning: 2026-01-29T05:30:13.982ZApplied to files:
📚 Learning: 2026-02-02T17:41:12.759ZApplied to files:
📚 Learning: 2026-02-03T07:34:34.184ZApplied to files:
📚 Learning: 2026-02-10T15:04:14.799ZApplied to files:
📚 Learning: 2026-02-25T11:00:02.013ZApplied to files:
📚 Learning: 2026-03-29T13:51:25.599ZApplied to files:
📚 Learning: 2026-01-12T11:24:13.825ZApplied to files:
📚 Learning: 2026-01-12T14:25:05.723ZApplied to files:
📚 Learning: 2026-01-20T01:03:13.139ZApplied to files:
📚 Learning: 2026-01-21T21:26:41.805ZApplied to files:
📚 Learning: 2026-01-25T13:18:21.675ZApplied to files:
📚 Learning: 2026-02-18T06:35:39.536ZApplied to files:
📚 Learning: 2026-02-23T16:33:22.070ZApplied to files:
📚 Learning: 2026-03-17T01:32:02.617ZApplied to files:
📚 Learning: 2026-03-17T01:32:02.617ZApplied to files:
📚 Learning: 2026-05-04T13:45:29.122ZApplied to files:
📚 Learning: 2026-05-04T13:45:33.892ZApplied to files:
📚 Learning: 2026-05-05T17:01:15.294ZApplied to files:
📚 Learning: 2026-05-08T12:49:20.694ZApplied to files:
📚 Learning: 2026-05-12T05:10:24.601ZApplied to files:
📚 Learning: 2026-05-13T19:23:09.603ZApplied to files:
📚 Learning: 2026-05-18T06:30:56.781ZApplied to files:
📚 Learning: 2026-05-18T06:31:12.015ZApplied to files:
📚 Learning: 2026-05-18T06:31:15.083ZApplied to files:
📚 Learning: 2026-05-18T06:31:20.848ZApplied to files:
📚 Learning: 2026-05-18T09:09:09.479ZApplied to files:
📚 Learning: 2026-05-19T07:48:17.119ZApplied to files:
📚 Learning: 2026-05-19T07:48:17.119ZApplied to files:
📚 Learning: 2026-05-26T15:52:31.613ZApplied to files:
📚 Learning: 2026-01-19T13:49:43.884ZApplied to files:
📚 Learning: 2026-05-03T15:38:09.624ZApplied to files:
📚 Learning: 2026-05-18T10:38:33.820ZApplied to files:
📚 Learning: 2026-05-19T17:16:55.817ZApplied to files:
🔇 Additional comments (5)
📝 WalkthroughWalkthroughTests now pass a ChangesPVC size utils & tests
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~22 minutes Suggested reviewers
✨ Finishing Touches🧪 Generate unit tests (beta)
|
|
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. |
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/utils.py`:
- Around line 729-737: Replace the redundant Bitmath conversion in the
PersistentVolumeClaim size parsing: in the assignment to raw_size_bytes that
uses bitmath.parse_string_unsafe(...).Byte.bytes, drop the intermediate .Byte
and use .bytes directly (i.e., call bitmath.parse_string_unsafe(...).bytes) so
raw_size_bytes becomes an int of the numeric byte value; keep the rest of the
logic (pvc, cdi_config check, and return) unchanged.
🪄 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: 22a71a13-ea89-4407-8828-fe7f569bc74b
📒 Files selected for processing (2)
tests/observability/metrics/test_vms_metrics.pytests/observability/metrics/utils.py
|
/lgtm |
|
/lgtm |
|
Clean rebase detected — no code changes compared to previous head ( |
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/utils.py`:
- Around line 736-737: The check that skips filesystem overhead uses
pvc.instance.spec.volumeMode but treats None as non-filesystem; update the
condition so omitted volumeMode (None) is treated as "Filesystem". Replace the
clause `if cdi_config is None or pvc.instance.spec.volumeMode != "Filesystem":`
with a guard that only treats non-filesystem when volumeMode is explicitly set
and not "Filesystem" (e.g., `if cdi_config is None or
(pvc.instance.spec.volumeMode is not None and pvc.instance.spec.volumeMode !=
"Filesystem"):`), keeping references to cdi_config and
pvc.instance.spec.volumeMode to locate the change.
🪄 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: 71df1862-6551-4a2d-ae93-46b4cf497289
📒 Files selected for processing (2)
tests/observability/metrics/test_vms_metrics.pytests/observability/metrics/utils.py
|
/retest all Auto-triggered: Files in this PR were modified by merged PR #4481. Overlapping filestests/observability/metrics/utils.py |
|
/lgtm |
|
/retest all Auto-triggered: Files in this PR were modified by merged PR #4648. Overlapping filestests/observability/metrics/test_vms_metrics.py |
| ).Byte.bytes | ||
| ) | ||
|
|
||
| pvc = PersistentVolumeClaim( |
There was a problem hiding this comment.
idk if you should get it from te cdi config...why not from the dv?
There was a problem hiding this comment.
I'm quite sure DV doesn't contain filesystemOverhead.
|
/retest all Auto-triggered: Files in this PR were modified by merged PR #4854. Overlapping filestests/observability/metrics/utils.py |
|
/retest all Auto-triggered: Files in this PR were modified by merged PR #4601. Overlapping filestests/observability/metrics/test_vms_metrics.py |
|
/retest all Auto-triggered: Files in this PR were modified by merged PR #4847. Overlapping filestests/observability/metrics/utils.py |
… size metric Refs: CNV-70944 Signed-off-by: Ohad <orevah@redhat.com>
4e1aa0d to
971da2a
Compare
|
/build-and-push-container |
|
New container for quay.io/openshift-cnv/openshift-virtualization-tests:pr-4350 published |
|
/retest all Auto-triggered: Files in this PR were modified by merged PR #4954. Overlapping filestests/observability/metrics/test_vms_metrics.py |
test_metric_kubevirt_vm_disk_allocated_size_bytes fails on filesystem-backed
storage classes (e.g., gcnv-flex on GCP) because get_pvc_size_bytes() returns
the raw PVC capacity while the Prometheus metric reports usable space after
filesystem overhead (~6%).
Modified get_pvc_size_bytes() to check the PVC volumeMode and, when set to
Filesystem, subtract the filesystem overhead from CDIConfig
(per-storage-class lookup with global fallback). Block PVCs remain unchanged.
Updated both Linux and Windows test call-sites to pass the cdi_config fixture.
Refs: CNV-70944
Co-Authored-By: Claude Opus 4.6 noreply@anthropic.com
Short description:
More details:
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-70944
Summary by CodeRabbit