Use rpm for guest agent version query#5092
Conversation
Signed-off-by: Geetika Kapoor <gkapoor@redhat.com>
Qodo reviews are paused for this user.Troubleshooting steps vary by plan Learn more → On a Teams plan? Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center? |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #5092 +/- ##
==========================================
- Coverage 98.67% 98.65% -0.02%
==========================================
Files 25 25
Lines 2487 2459 -28
==========================================
- Hits 2454 2426 -28
Misses 33 33
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
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. |
📝 WalkthroughWalkthroughUpdated ChangesGuest agent version lookup
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related issues
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 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 |
|
/retest all Auto-triggered: Files in this PR were modified by merged PR #4954. Overlapping filesutilities/infra.py |
|
/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
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
# 6a: Identify modified symbols
echo "=== Modified symbols ==="
git diff HEAD~1 --unified=0 -- utilities/infra.py | grep '^[+-]def '
# 6b: Find direct callers of get_linux_guest_agent_version
echo "=== Direct callers in tests/ ==="
rg -rn 'get_linux_guest_agent_version' tests/ --include="*.py" -l
echo "=== Direct callers in conftest ==="
rg -rn 'get_linux_guest_agent_version' --include="conftest.py" -l
echo "=== All callers (full match) ==="
rg -rn 'get_linux_guest_agent_version' --include="*.py" -n
# 6d: Trace same-file callers in utilities/infra.py
echo "=== Same-file callers ==="
rg 'get_linux_guest_agent_version' utilities/infra.py -n
# 7: Smoke tests
echo "=== Smoke test files ==="
rg -l '`@pytest.mark.smoke`' tests/
# 8: Gating tests
echo "=== Gating test files ==="
rg -l '`@pytest.mark.gating`' tests/Length of output: 5848 🏁 Script executed: #!/bin/bash
# Find all callers of get_linux_guest_agent_version
echo "=== All callers ==="
rg 'get_linux_guest_agent_version' -n -g '*.py'
# Get context around line 1157 in utilities/infra.py to find the wrapping function
echo "=== Context around line 1157 in utilities/infra.py ==="
sed -n '1140,1180p' utilities/infra.py
# Find callers of the wrapping function (whatever calls get_linux_guest_agent_version at line 1157)
echo "=== grep for guest_agent_version in tests ==="
rg 'guest_agent_version' -n -g '*.py' tests/
echo "=== grep for guest_agent_version in conftest ==="
rg 'guest_agent_version' -n conftest.py 2>/dev/null || true
rg 'guest_agent_version' -rn -g 'conftest.py'Length of output: 5538 🏁 Script executed: #!/bin/bash
# Find callers of get_linux_os_info
echo "=== Callers of get_linux_os_info ==="
rg 'get_linux_os_info' -n -g '*.py'
# Check markers in test_guest_load_metrics.py
echo "=== Markers in test_guest_load_metrics.py ==="
grep -n 'pytest.mark' tests/observability/metrics/test_guest_load_metrics.py
# Verify test_rhel_os_support.py uses xfail_old_guest_agent_version fixture
echo "=== test_rhel_os_support.py fixture usage ==="
grep -n 'xfail_old_guest_agent_version\|guest_agent' tests/virt/cluster/common_templates/rhel/test_rhel_os_support.py
# Check conftest at line 157 context
echo "=== conftest.py around line 157 ==="
sed -n '145,165p' tests/virt/cluster/common_templates/conftest.py
# Check test_base_template.py uses xfail fixture
echo "=== test_base_template.py guest agent usage ==="
grep -n 'xfail_old_guest_agent_version\|guest_agent' tests/virt/cluster/common_templates/general/test_base_template.pyLength of output: 4341 🏁 Script executed: #!/bin/bash
# Get the diff for PR `#5092` to find first changed line
gh pr diff 5092 --repo RedHatQE/openshift-virtualization-tests | head -60Length of output: 763 🏁 Script executed: #!/bin/bash
# Get PR head commit SHA
gh pr view 5092 --repo RedHatQE/openshift-virtualization-tests --json headRefOid -q '.headRefOid'Length of output: 220 🏁 Script executed: #!/bin/bash
# Post inline review comment on first changed line of utilities/infra.py
BODY="**Test Execution Plan**
**Run smoke tests: True**
Dependency path: \`tests/virt/cluster/common_templates/rhel/test_rhel_os_support.py::TestRhelOsSupport::test_virtctl_guest_agent_fs_info\` → fixture \`xfail_rhel_with_old_guest_agent\` (\`tests/virt/cluster/common_templates/conftest.py\`) → \`xfail_old_guest_agent_version()\` (\`tests/virt/cluster/common_templates/utils.py:40\`) → \`get_linux_guest_agent_version()\` (\`utilities/infra.py\`)
**Run gating tests: False**
No gating-marked test has a traceable path to \`get_linux_guest_agent_version\`.
**Affected tests to run**
- \`tests/virt/cluster/common_templates/rhel/test_rhel_os_support.py::TestRhelOsSupport::test_virtctl_guest_agent_fs_info\` (smoke)
- \`tests/observability/metrics/test_guest_load_metrics.py\` — uses \`qemu_guest_agent_version_validated\` fixture (\`tests/observability/metrics/conftest.py:599\`) → \`get_linux_guest_agent_version()\`"
gh api repos/RedHatQE/openshift-virtualization-tests/pulls/5092/comments \
--method POST \
--field body="$BODY" \
--field commit_id="5c5ef7b6937cad634ca55dbdc35699cffe9a5aa7" \
--field path="utilities/infra.py" \
--field line=1150 \
--field side="RIGHT"Length of output: 4999 |
|
/verified cancel |
|
/build-and-push-container |
|
New container for quay.io/openshift-cnv/openshift-virtualization-tests:pr-5092 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
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
# Get current head commit SHA
HEAD_SHA=$(gh pr view 5092 --repo RedHatQE/openshift-virtualization-tests --json headRefOid -q '.headRefOid')
echo "HEAD SHA: $HEAD_SHA"
# Get the diff to confirm first changed line
gh pr diff 5092 --repo RedHatQE/openshift-virtualization-tests | head -40
# Post inline review comment on the first changed line
BODY="**Test Execution Plan**
**Run smoke tests: True**
Dependency path: \`tests/virt/cluster/common_templates/rhel/test_rhel_os_support.py::TestRhelOsSupport::test_virtctl_guest_agent_fs_info\` → fixture \`xfail_rhel_with_old_guest_agent\` (\`tests/virt/cluster/common_templates/conftest.py\`) → \`xfail_old_guest_agent_version()\` (\`tests/virt/cluster/common_templates/utils.py\`) → \`get_linux_guest_agent_version()\` (\`utilities/infra.py\`)
**Run gating tests: False**
No gating-marked test has a traceable path to \`get_linux_guest_agent_version\`.
**Affected tests to run**
- \`tests/virt/cluster/common_templates/rhel/test_rhel_os_support.py::TestRhelOsSupport::test_virtctl_guest_agent_fs_info\` (smoke)
- \`tests/observability/metrics/test_guest_load_metrics.py\` — uses \`qemu_guest_agent_version_validated\` fixture (\`tests/observability/metrics/conftest.py\`) → \`get_linux_guest_agent_version()\`"
gh api repos/RedHatQE/openshift-virtualization-tests/pulls/5092/comments \
--method POST \
--field body="$BODY" \
--field commit_id="$HEAD_SHA" \
--field path="utilities/infra.py" \
--field line=1150 \
--field side="RIGHT"
echo "Exit code: $?"Length of output: 5887 🧠 Learnings used |
rnetser
left a comment
There was a problem hiding this comment.
this change should be done on rrmngmnt side
@rnetser you mean here https://github.com/rhevm-qe-automation/python-rrmngmnt? |
What this PR does / why we need it:
rrmngmnt uses
whichto detect package managers and fails when which itself is missing.whichis not installed on the CentOS Stream 10 image. Identified while doing some tests with centos-stream10.Which issue(s) this PR fixes:
this is seen during testing centos-stream10
FAILED tests/infrastructure/golden_images/update_boot_source/test_boot_sources_vm.py::test_instance_type_vm_from_auto_update_boot_source[#centos-stream10-arm64#] - RuntimeError: Can not determine package manager for Host(centos-stream10-arm64-data-source-vm-1779873870-1084452)
FAILED tests/infrastructure/golden_images/update_boot_source/test_boot_sources_vm.py::test_instance_type_vm_from_auto_update_boot_source[#fedora-arm64#] - RuntimeError: Can not determine package manager for Host(fedora-arm64-data-source-vm-1779873945-74379)
Special notes for reviewer:
None
jira-ticket:
None