fix(vhostmd): allign ResourceProcessorLimit metric type with KubeVirt#5490
fix(vhostmd): allign ResourceProcessorLimit metric type with KubeVirt#5490geetikakay wants to merge 1 commit into
Conversation
Signed-off-by: Geetika Kapoor <gkapoor@redhat.com>
📝 WalkthroughWalkthroughThis change updates a single expected value in a test file, changing the expected metric type for ChangesTest expectation fix
Estimated code review effort: 1 (Trivial) | ~2 minutes Related issues: None found in the provided context. Related PRs: None found in the provided context. Suggested labels: none Suggested reviewers: none Poem: Caution Pre-merge checks failedPlease resolve all errors before merging. Addressing warnings is optional.
❌ Failed checks (1 error)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Warning Review ran into problems🔥 ProblemsLinked repositories: Your configuration references 1 linked repositories, but your current plan allows 0. Analyzed ``, skipped 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
Branch Management
Custom Commands
Label Management
✅ Merge RequirementsThis PR will be automatically approved when the following conditions are met:
📊 Review ProcessApprovers and ReviewersApprovers:
Reviewers:
Available Labels
AI Features
Security Checks
💡 Tips
For more information, please refer to the project documentation or contact the maintainers. |
|
/build-and-push-container |
|
New container for quay.io/openshift-cnv/openshift-virtualization-tests:pr-5490 published |
|
/verified |
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:
Output rules: Your deliverable: Test Execution Plan
Use these formats:
Real test commands (MANDATORY when changes affect session/runtime code): When the affected code runs at session/collection time (conftest fixtures, pytest plugins,
Example output for a session-startup fix: 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 — Verification rules for smoke and gating decisions: |
|
Tip For best results, initiate chat on the files or code changes. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
gh pr diff 5490 -R RedHatQE/openshift-virtualization-tests
echo "---- markers in file ----"
fd test_downwardmetrics_virtio.py -x cat -n {}
echo "---- smoke/gating markers ----"
rg -n '`@pytest.mark`.(smoke|gating)' tests/infrastructure/vhostmd/ || true
echo "---- conftest hierarchy ----"
fd conftest.py tests/infrastructure/vhostmd tests/infrastructure -x echo {}Length of output: 9821 🏁 Script executed: #!/bin/bash
set -euo pipefail
COMMENT_BODY=$(cat <<'EOF'
**Test Execution Plan**
- **Run smoke tests: False** — No smoke-marked tests found in `tests/infrastructure/vhostmd/`, and no `utilities/`/`libs/` symbols were modified.
- **Run gating tests: False** — No gating-marked tests found in this path; change is confined to test-data assertion only.
- **Affected tests to run**
- `tests/infrastructure/vhostmd/test_downwardmetrics_virtio.py::test_downward_metrics_virtio_serial_port` — directly asserts against the updated `EXPECTED_METRICS` set (line 34: `ResourceProcessorLimit` type `uint64` → `int64`).
- `test_downward_metrics_virtio_serial_port_default` is unaffected (does not reference `EXPECTED_METRICS`).
**Real tests (cluster required)**
Fix path (verifies alignment with KubeVirt's updated `DomainStats`):
`pytest tests/infrastructure/vhostmd/test_downwardmetrics_virtio.py::test_downward_metrics_virtio_serial_port`
Expected: collected `ResourceProcessorLimit` metric type is `int64` and matches `EXPECTED_METRICS`, no assertion failure.
Happy path (regression, feature-gate-disabled scenario):
`pytest tests/infrastructure/vhostmd/test_downwardmetrics_virtio.py::test_downward_metrics_virtio_serial_port_default`
Expected: `UnprocessibleEntityError` raised as before (unaffected by this change).
EOF
)
# Get PR head commit SHA and first changed file/line
PR_JSON=$(gh pr view 5490 -R RedHatQE/openshift-virtualization-tests --json headRefOid)
COMMIT_SHA=$(echo "$PR_JSON" | jq -r '.headRefOid')
gh api \
repos/RedHatQE/openshift-virtualization-tests/pulls/5490/comments \
-f body="$COMMENT_BODY" \
-f commit_id="$COMMIT_SHA" \
-f path="tests/infrastructure/vhostmd/test_downwardmetrics_virtio.py" \
-F line=34 \
-f side="RIGHT"Length of output: 5980 Inline test execution plan comment has been posted on line 34 of |
What this PR does / why we need it:
KubeVirt commit c7d5c82f26 removed NrVirtCpu from DomainStats because it was redundant. The scraper already loops over vmStats.Vcpu for TotalCPUTime, so it can count online vCPUs in the same pass instead of carrying a separate field from libvirt.onlineVcpus is int → XML type="int64"
Which issue(s) this PR fixes:
Special notes for reviewer:
jira-ticket:
seen in recent CI runs
Summary by CodeRabbit