Skip to content

fix: use architecture-aware RHEL preference in snapshot fixtures#4866

Open
carterpewpew wants to merge 1 commit into
RedHatQE:mainfrom
carterpewpew:fix/use-arch-aware-rhel-preference-for-snapshot-fixtures
Open

fix: use architecture-aware RHEL preference in snapshot fixtures#4866
carterpewpew wants to merge 1 commit into
RedHatQE:mainfrom
carterpewpew:fix/use-arch-aware-rhel-preference-for-snapshot-fixtures

Conversation

@carterpewpew

@carterpewpew carterpewpew commented May 14, 2026

Copy link
Copy Markdown
Contributor

Short description: Use architecture-aware RHEL preference in snapshot and vmexport fixtures

More details:
The rhel_vm_for_snapshot and rhel_vm_for_snapshot_with_content fixtures hardcode RHEL10_PREFERENCE, which enables SecureBoot. On s390x, SecureBoot is unsupported (no EFI OVMF ROMs), causing VM boot failures. The codebase already handles this via per-architecture global configs -- these fixtures were bypassing that.

What this PR does / why we need it:

  • Replaces hardcoded RHEL10 preference and data source in both fixtures with dynamic lookup via py_config["latest_instance_type_rhel_os_dict"]
  • Adds a latest_rhel_data_source_scope_session fixture to tests/conftest.py alongside the existing rhel9/rhel10 data source fixtures
  • Resolves to RHEL9 on s390x (no SecureBoot) and RHEL10 on amd64/arm64

Which issue(s) this PR fixes:

Special notes for reviewer:

jira-ticket: NONE

Summary by CodeRabbit

  • Tests
    • Added a session-scoped fixture to provide the latest RHEL data source for the current architecture.
    • Updated snapshot and export test fixtures to use the latest RHEL flow and derive instance-type preferences from test configuration instead of hardcoded values.
    • Removed a duplicate module-scoped fixture to consolidate how the latest RHEL data source is provided.

Review Change Stack

@coderabbitai

coderabbitai Bot commented May 14, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

@carterpewpew, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 59 minutes and 58 seconds. Learn how PR review limits work.

Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file).

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: bf37599f-83be-4259-854c-8851399066ac

📥 Commits

Reviewing files that changed from the base of the PR and between 452d3c4 and 781c85b.

📒 Files selected for processing (4)
  • tests/conftest.py
  • tests/infrastructure/conftest.py
  • tests/storage/conftest.py
  • tests/storage/vm_export/conftest.py
📝 Walkthrough

Walkthrough

Add a session-scoped latest_rhel_data_source fixture in tests/conftest.py; switch storage and vm_export fixtures to consume it and derive VM preferences from py_config["latest_instance_type_rhel_os_dict"]; remove the duplicate fixture and unused imports from tests/infrastructure/conftest.py.

Changes

Latest RHEL Fixture Configuration

Layer / File(s) Summary
New latest RHEL data source fixture
tests/conftest.py
Adds DATA_SOURCE_NAME import and a session-scoped latest_rhel_data_source fixture that returns a DataSource named from py_config["latest_instance_type_rhel_os_dict"][DATA_SOURCE_NAME], scoped to golden_images_namespace with ensure_exists=True.
Storage snapshot VM fixture update
tests/storage/conftest.py
Replace RHEL10_PREFERENCE import with PREFERENCE_STR, update rhel_vm_for_snapshot to accept latest_rhel_data_source, derive vm_preference from py_config["latest_instance_type_rhel_os_dict"][PREFERENCE_STR], and use latest_rhel_data_source for the data_volume_template.
VM export snapshot fixture update
tests/storage/vm_export/conftest.py
Add py_config import, update rhel_vm_for_snapshot_with_content to accept latest_rhel_data_source, compute vm_preference from py_config["latest_instance_type_rhel_os_dict"][PREFERENCE_STR], and switch the data_volume_template data source to latest_rhel_data_source.
Infrastructure conftest cleanup
tests/infrastructure/conftest.py
Remove the module-scoped latest_rhel_data_source fixture and delete now-unused imports; consolidate remaining import lines.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • RedHatQE/openshift-virtualization-tests#4788: Updates RHEL fixtures to read “latest” RHEL DataSource/vm_preference from py_config["latest_instance_type_rhel_os_dict"], which is related to multiarch preference/name generation changes.

Suggested labels

new-tests

Suggested reviewers

  • vsibirsk
  • dshchedr
  • rnetser
  • RoniKishner
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with 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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@openshift-virtualization-qe-bot-3

Copy link
Copy Markdown
Contributor

Report bugs in Issues

Welcome! 🎉

This pull request will be automatically processed with the following features:

🔄 Automatic Actions

  • Reviewer Assignment: Reviewers are automatically assigned based on the OWNERS file in the repository root
  • Size Labeling: PR size labels (XS, S, M, L, XL, XXL) are automatically applied based on changes
  • Issue Creation: A tracking issue is created for this PR and will be closed when the PR is merged or closed
  • Branch Labeling: Branch-specific labels are applied to track the target branch
  • Auto-verification: Auto-verified users have their PRs automatically marked as verified
  • Labels: Enabled categories: branch, can-be-merged, cherry-pick, has-conflicts, hold, needs-rebase, size, verified, wip

📋 Available Commands

PR Status Management

  • /wip - Mark PR as work in progress (adds WIP: prefix to title)
  • /wip cancel - Remove work in progress status
  • /hold - Block PR merging (approvers only)
  • /hold cancel - Unblock PR merging
  • /verified - Mark PR as verified
  • /verified cancel - Remove verification status
  • /reprocess - Trigger complete PR workflow reprocessing (useful if webhook failed or configuration changed)
  • /regenerate-welcome - Regenerate this welcome message

Review & Approval

  • /lgtm - Approve changes (looks good to me)
  • /approve - Approve PR (approvers only)
  • /assign-reviewers - Assign reviewers based on OWNERS file
  • /assign-reviewer @username - Assign specific reviewer
  • /check-can-merge - Check if PR meets merge requirements

Testing & Validation

  • /retest tox - Run Python test suite with tox
  • /retest build-container - Rebuild and test container image
  • /retest verify-bugs-are-open - verify-bugs-are-open
  • /retest all - Run all available tests

Container Operations

  • /build-and-push-container - Build and push container image (tagged with PR number)
    • Supports additional build arguments: /build-and-push-container --build-arg KEY=value

Cherry-pick Operations

  • /cherry-pick <branch> - Schedule cherry-pick to target branch when PR is merged
    • Multiple branches: /cherry-pick branch1 branch2 branch3

Label Management

  • /<label-name> - Add a label to the PR
  • /<label-name> cancel - Remove a label from the PR

✅ Merge Requirements

This PR will be automatically approved when the following conditions are met:

  1. Approval: /approve from at least one approver
  2. LGTM Count: Minimum 2 /lgtm from reviewers
  3. Status Checks: All required status checks must pass
  4. No Blockers: No wip, hold, has-conflicts labels and PR must be mergeable (no conflicts)
  5. Verified: PR must be marked as verified

📊 Review Process

Approvers and Reviewers

Approvers:

  • dshchedr
  • jpeimer
  • myakove
  • rnetser
  • vsibirsk

Reviewers:

  • Ahmad-Hafe
  • RoniKishner
  • acinko-rh
  • dalia-frank
  • dshchedr
  • ema-aka-young
  • josemacassan
  • jpeimer
  • kgoldbla
  • kshvaika
  • rnetser
  • vsibirsk
Available Labels
  • hold
  • verified
  • wip
  • lgtm
  • approve
AI Features
  • Cherry-Pick Conflict Resolution: Enabled (claude/claude-opus-4-6[1m])

💡 Tips

  • WIP Status: Use /wip when your PR is not ready for review
  • Verification: The verified label is removed on new commits unless the push is detected as a clean rebase
  • Cherry-picking: Cherry-pick labels are processed when the PR is merged
  • Container Builds: Container images are automatically tagged with the PR number
  • Permission Levels: Some commands require approver permissions
  • Auto-verified Users: Certain users have automatic verification and merge privileges

For more information, please refer to the project documentation or contact the maintainers.

@carterpewpew

Copy link
Copy Markdown
Contributor Author

cc @alexandermamaniy

coderabbitai[bot]
coderabbitai Bot previously approved these changes May 14, 2026
@jpeimer

jpeimer commented May 14, 2026

Copy link
Copy Markdown
Contributor

/lgtm

@openshift-virtualization-qe-bot-5

Copy link
Copy Markdown

Clean rebase detected — no code changes compared to previous head (5137940).
The following labels were preserved: lgtm-jpeimer, lgtm-coderabbitai[bot].

@openshift-virtualization-qe-bot-3

Copy link
Copy Markdown
Contributor

Clean rebase detected — no code changes compared to previous head (92746ba).
The following labels were preserved: commented-carterpewpew.

@carterpewpew carterpewpew force-pushed the fix/use-arch-aware-rhel-preference-for-snapshot-fixtures branch from 3b7e4a8 to 7e532ce Compare May 19, 2026 05:37
@openshift-virtualization-qe-bot-2

Copy link
Copy Markdown
Contributor

Clean rebase detected — no code changes compared to previous head (3b7e4a8).
The following labels were preserved: commented-carterpewpew.

@rnetser rnetser left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/approve
/lgtm

@openshift-virtualization-qe-bot-3

Copy link
Copy Markdown
Contributor

Clean rebase detected — no code changes compared to previous head (7e532ce).
The following labels were preserved: lgtm-dshchedr, lgtm-rnetser, approved-rnetser, lgtm-coderabbitai[bot], commented-carterpewpew.

@openshift-virtualization-qe-bot-3

Copy link
Copy Markdown
Contributor

/retest all

Auto-triggered: Files in this PR were modified by merged PR #4856.

Overlapping files

tests/conftest.py

@openshift-virtualization-qe-bot-3

Copy link
Copy Markdown
Contributor

/retest all

Auto-triggered: Files in this PR were modified by merged PR #4896.

Overlapping files

tests/conftest.py

@jpeimer

jpeimer commented May 25, 2026

Copy link
Copy Markdown
Contributor

/approve
/lgtm

@openshift-virtualization-qe-bot-3

Copy link
Copy Markdown
Contributor

/retest all

Auto-triggered: Files in this PR were modified by merged PR #4934.

Overlapping files

tests/conftest.py

@jpeimer

jpeimer commented Jun 2, 2026

Copy link
Copy Markdown
Contributor

/approve
/lgtm

@openshift-virtualization-qe-bot-3

Copy link
Copy Markdown
Contributor

/retest all

Auto-triggered: Files in this PR were modified by merged PR #4985.

Overlapping files

tests/conftest.py
tests/storage/conftest.py

@openshift-virtualization-qe-bot-3

Copy link
Copy Markdown
Contributor

/retest all

Auto-triggered: Files in this PR were modified by merged PR #5099.

Overlapping files

tests/storage/conftest.py

@carterpewpew

Copy link
Copy Markdown
Contributor Author

/verified

@openshift-virtualization-qe-bot-3

Copy link
Copy Markdown
Contributor

@coderabbitai

Test execution plan request details

CRITICAL: You MUST post an inline review comment on the first changed line of the first file.
The inline comment should contain the full Test Execution Plan (smoke decision, gating decision, and specific affected tests).
Do NOT submit a blocking review event (REQUEST_CHANGES/APPROVE).
Post a single inline PR comment on Files Changed (non-blocking COMMENT flow).

As an expert software testing engineer, analyze all modified files in this PR and create a targeted test execution plan.
You will post an inline review comment with the test execution plan on the first changed file.
If you fail to run or post a comment, retry.

Analysis Requirements:

  1. Examine code changes in each modified file

  2. Identify affected code paths, functions, and classes

  3. Analyze pytest-specific elements: fixtures (scope, dependencies), parametrization, markers, conftest changes

  4. Trace test dependencies through imports, shared utilities, fixture inheritance, fixture teardown, and yield from cleanup in conftest

  5. Detect new tests introduced in the PR

  6. Utilities and libs impact (when utilities/ or libs/ changes):
    You MUST use shell scripts (rg, git diff) to trace the full impact.
    Follow these sub-steps in order:

    6a. Identify modified symbols: For each changed file under utilities/ or libs/,
    list every modified function or method.
    Example: git diff HEAD~1 --unified=0 -- utilities/hco.py | grep '^[+-]def '

    6b. Find direct callers: Search tests and conftest for each symbol from 6a.
    Example: rg -l 'get_hco_version' tests/

    6c. Trace fixture teardown and cleanup: Find fixtures that reach
    the modified symbol through yield from or context-manager wrappers.
    Example: rg -l 'yield from.*enable_common_boot|def.*enable_common_boot' tests/

    6d. Trace same-file callers: In each changed file, find other functions
    whose body calls a modified symbol (including code after yield
    in @contextmanager helpers).
    Example: rg 'get_hco_version|enable_common_boot' utilities/hco.py

    6e. Expand transitively: If function A calls modified B, then
    tests/fixtures that call A are affected — even when the test body
    never imports B directly.

    Do NOT limit impact to tests that import the modified symbol only.

  7. Smoke test impact: Intersect the affected set from step 6 with smoke-marked tests.
    Run: rg -l '@pytest.mark.smoke' tests/
    VERIFY the above command returned actual file paths before concluding False.
    Set True if either condition is met:

    • a smoke-marked file appears in the affected set from 6b-6e, OR
    • any conftest.py in the smoke test's parent-directory hierarchy (up to repo root)
      imports or calls a modified utilities/libs symbol — including autouse fixtures
      that depend on modified functions. ALL tests in that directory and below are affected.
      Example check: for each smoke_file, scan dirname(smoke_file)/conftest.py,
      dirname(dirname(smoke_file))/conftest.py, etc. for modified symbol imports
      and autouse fixtures that depend on modified symbols.
  8. Gating test impact: Intersect the affected set from step 6 with gating-marked tests.
    Run: rg -l '@pytest.mark.gating' tests/
    Set True if a gating-marked file also appears in the affected set from 6b-6e.
    Utilities/libs changes often affect gating tests without affecting smoke tests.
    Do NOT stop analysis after concluding Run smoke tests: False.

Output rules:
Do NOT include analysis step numbers (1-8) in your visible output.

Your deliverable:
Your inline informational comment will be based on the following requirements:

Test Execution Plan

  • Run smoke tests: True / False — If True, state the dependency path (test → fixture → changed symbol). True ONLY with a verified path.
  • Run gating tests: True / False — If True, state the dependency path. True if any gating-marked test is in the affected set.
  • Affected tests to run (required when utilities/, libs/, or shared conftest changes — list concrete paths even when smoke is False)

Use these formats:

  • path/to/test_file.py - When the entire test file needs verification
  • path/to/test_file.py::TestClass::test_method - When specific test(s) needed
  • path/to/test_file.py::test_function - When specific test(s) needed
  • -m marker - When a marker covers multiple affected tests (e.g. -m gating only if ALL gating tests in scope need run)
  • Tag each listed test or group with its marker when not obvious, e.g. (gating) or (smoke)

Real test commands (MANDATORY when changes affect session/runtime code):

When the affected code runs at session/collection time (conftest fixtures, pytest plugins,
config hooks, session-scoped setup) or modifies runtime behavior that unit tests mock away,
you MUST include concrete pytest commands the PR author must run on a real cluster
to verify the change works end-to-end. Include:

  • A command for the error/fix path (the scenario the PR fixes)
  • A command for the happy path (regression: the normal case still works)
  • Use lightweight tests (e.g., --collect-only for startup failures,
    a single small test for runtime behavior)
    If the PR only changes test logic (not utilities/libs/conftest), the affected test
    paths themselves serve as the real test commands — no separate section needed.

Example output for a session-startup fix:

**Real tests (cluster required)**
Error path (the fix):
`pytest tests/storage/.../test_foo.py --storage-class-matrix=nonexistent-sc --collect-only`
Expected: ValueError with clear message, not IndexError

Happy path (regression):
`pytest tests/storage/.../test_foo.py --storage-class-matrix=<valid-sc> -k test_bar`
Expected: session starts normally

Guidelines:

  • Include tests affected directly OR via fixture setup/teardown, yield from cleanup, or transitive utility call chains (caller calls modified helper)
  • Use a full file path only if ALL tests in that file require verification
  • Use file path + test name when only specific tests use an affected fixture or utility wrapper (preferred for partial file impact)
  • If a test marker can cover multiple files/tests, provide the marker
  • Balance coverage vs over-testing - Keep descriptions minimal
  • Example: if leaf helper foo() changes, include tests whose fixture teardown calls wrapper bar() where bar() calls foo(), even when the test body only imports an unrelated symbol from the same utilities module

Hardware-Related Checks (SR-IOV, GPU, DPDK):

When PR modifies fixtures for hardware-specific resources:

  • Collection Safety: Fixtures MUST have existence checks (return None when hardware unavailable)
  • Test Plan: MUST verify both WITH and WITHOUT hardware:
    • Run affected tests on cluster WITH hardware
    • Verify collection succeeds on cluster WITHOUT hardware

CRITICAL WORKFLOW COMPLETION RULES:

When responding to this test execution plan request, you MUST follow these rules EXACTLY:

  1. YOUR ONLY DELIVERABLE: Post one non-blocking inline comment containing the test execution plan on the first changed line
  2. THEN STOP IMMEDIATELY - Do NOT generate any additional response
  3. FALLBACK ONLY: If inline comment API calls fail after retrying, post as a regular PR comment
  4. SILENCE = SUCCESS: After successfully submitting the review, your task is complete. No confirmation needed.

ABSOLUTE PROHIBITIONS (violating these creates empty/meaningless reviews):

  • ❌ Do NOT post acknowledgment messages like "Test execution plan posted", "Review posted successfully", "I've successfully posted"
  • ❌ Do NOT mention review IDs, URLs, or confirmation of posting in the PR thread
  • ❌ Do NOT add any follow-up comments after submitting the review
  • ❌ Do NOT reply to confirm task completion
  • ❌ Do NOT explain what you did - just do it and stop

Remember: The pull request review is visible to users. Additional comments are redundant noise.

CRITICAL — Verification rules for smoke and gating decisions:
- For each True decision, you must have traced a concrete path: test file → fixture → utility function → modified symbol.
- Do NOT assume impact based on scope, file proximity, or infrastructure-sounding names.
Only set True when you trace a concrete path through steps 6a-6e, then 7 or 8.
WRONG: "utilities/hco.py changed → run smoke" (no traced dependency path)
WRONG: "Run smoke tests: False" with no affected-test list when gating tests use the changed utility
RIGHT: "Run smoke tests: False, Run gating tests: True" plus tests/.../test_foo.py::TestBar::test_baz (gating)
RIGHT: "Smoke test X uses fixture Y → wrapper Z → changed function W in utilities/hco.py"

Comment thread tests/conftest.py
@coderabbitai

coderabbitai Bot commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

Tip

For best results, initiate chat on the files or code changes.

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
echo "=== Tests using rhel_vm_for_snapshot ==="
rg -rn "rhel_vm_for_snapshot" tests/ --include="*.py" -l

echo ""
echo "=== Tests using rhel_vm_for_snapshot_with_content ==="
rg -rn "rhel_vm_for_snapshot_with_content" tests/ --include="*.py" -l

echo ""
echo "=== Tests using latest_rhel_data_source ==="
rg -rn "latest_rhel_data_source" tests/ --include="*.py" -l

echo ""
echo "=== Smoke-marked tests in storage ==="
rg -rn "`@pytest.mark.smoke`" tests/storage/ --include="*.py" -l

echo ""
echo "=== Gating-marked tests in storage ==="
rg -rn "`@pytest.mark.gating`" tests/storage/ --include="*.py" -l

echo ""
echo "=== All smoke-marked test files ==="
rg -l "`@pytest.mark.smoke`" tests/ --include="*.py"

echo ""
echo "=== All gating-marked test files ==="
rg -l "`@pytest.mark.gating`" tests/ --include="*.py"

echo ""
echo "=== Storage snapshot test files ==="
fd "test_.*snapshot" tests/storage/ --extension py

echo ""
echo "=== VM export test files ==="
fd "test_" tests/storage/vm_export/ --extension py

echo ""
echo "=== Smoke/gating in snapshot test files ==="
rg -l "`@pytest.mark.smoke`|`@pytest.mark.gating`" tests/storage/ --include="*snapshot*"

Length of output: 5486


🏁 Script executed:

#!/bin/bash
echo "=== Tests using rhel_vm_for_snapshot ==="
rg -l "rhel_vm_for_snapshot" tests/

echo ""
echo "=== Tests using rhel_vm_for_snapshot_with_content ==="
rg -l "rhel_vm_for_snapshot_with_content" tests/

echo ""
echo "=== Tests using latest_rhel_data_source ==="
rg -l "latest_rhel_data_source" tests/

echo ""
echo "=== Smoke marks in snapshot test files ==="
rg "`@pytest.mark.smoke`" tests/storage/snapshots/test_snapshots.py tests/storage/golden_image/test_cached_snapshots.py tests/storage/vm_export/test_vm_export.py || echo "No smoke marks found"

echo ""
echo "=== Gating marks in snapshot test files ==="
rg "`@pytest.mark.gating`" tests/storage/snapshots/test_snapshots.py tests/storage/golden_image/test_cached_snapshots.py tests/storage/vm_export/test_vm_export.py || echo "No gating marks found"

echo ""
echo "=== All smoke-marked files ==="
rg -l "`@pytest.mark.smoke`" tests/

echo ""
echo "=== All gating-marked files ==="
rg -l "`@pytest.mark.gating`" tests/

echo ""
echo "=== Snapshot test file functions using rhel_vm_for_snapshot ==="
rg -n "rhel_vm_for_snapshot" tests/storage/snapshots/test_snapshots.py tests/storage/golden_image/test_cached_snapshots.py || echo "Not found in those files"

echo ""
echo "=== VM export test functions using rhel_vm_for_snapshot_with_content ==="
rg -n "rhel_vm_for_snapshot_with_content" tests/storage/vm_export/test_vm_export.py || echo "Not found"

Length of output: 9331


🏁 Script executed:

#!/bin/bash
# Get PR info to find diff position for inline comment
gh pr view 4866 --repo RedHatQE/openshift-virtualization-tests --json files

echo ""
echo "=== Get PR diff to find line numbers ==="
gh api repos/RedHatQE/openshift-virtualization-tests/pulls/4866/files --jq '.[] | {filename: .filename, patch: .patch}' | head -100

echo ""
echo "=== Get latest commit SHA for inline comment ==="
gh pr view 4866 --repo RedHatQE/openshift-virtualization-tests --json headRefOid

echo ""
echo "=== Check infrastructure instance_types conftest for latest_rhel_data_source usage ==="
rg -n "latest_rhel_data_source" tests/infrastructure/instance_types/conftest.py || echo "Not found"

echo ""
echo "=== Check test_rhel_os.py for latest_rhel_data_source usage ==="
rg -n "latest_rhel_data_source" tests/infrastructure/instance_types/supported_os/test_rhel_os.py || echo "Not found in test file directly"

echo ""
echo "=== Check vhostmd test ==="
rg -n "latest_rhel_data_source" tests/infrastructure/vhostmd/test_vhostmd.py || echo "Not found"

echo ""
echo "=== Check gating in instance_types tests ==="
rg -n "`@pytest.mark.gating`" tests/infrastructure/instance_types/ || echo "None"

Length of output: 8151


🏁 Script executed:

#!/bin/bash
echo "=== Does test_rhel_os.py use rhel_vm_for_dedicated_cpu? ==="
rg -n "rhel_vm_for_dedicated_cpu" tests/infrastructure/instance_types/

echo ""
echo "=== Does vhostmd test have smoke or gating marks? ==="
rg -n "`@pytest.mark.smoke`|`@pytest.mark.gating`" tests/infrastructure/vhostmd/test_vhostmd.py || echo "No smoke/gating in vhostmd"

echo ""
echo "=== First changed line number in tests/conftest.py (from diff) ==="
gh api repos/RedHatQE/openshift-virtualization-tests/pulls/4866/files --jq '.[] | select(.filename=="tests/conftest.py") | .patch' | head -5

Length of output: 1305


🏁 Script executed:

#!/bin/bash
# Post inline review comment on tests/conftest.py at the first changed line (position 5)
BODY="## Test Execution Plan

**Run smoke tests: False**
No verified dependency path from any smoke-marked test to the modified fixtures. \`tests/infrastructure/instance_types/supported_os/test_rhel_os.py\` (smoke) does not use \`rhel_vm_for_dedicated_cpu\` or any other fixture that consumes \`latest_rhel_data_source\`.

**Run gating tests: True**
- \`tests/storage/vm_export/test_vm_export.py\` (gating) → \`rhel_vm_for_snapshot_with_content\` (tests/storage/vm_export/conftest.py) → \`latest_rhel_data_source\` (scope changed: module→session, moved to tests/conftest.py)
- \`tests/infrastructure/instance_types/test_common_vm_instancetype.py\` (gating) → \`rhel_vm_for_dedicated_cpu\` (tests/infrastructure/instance_types/conftest.py) → \`latest_rhel_data_source\`

**Affected tests to run**

| Test file | Marker | Changed fixture dependency |
|---|---|---|
| \`tests/storage/snapshots/test_snapshots.py\` | — | \`rhel_vm_for_snapshot\`\`latest_rhel_data_source\` |
| \`tests/storage/vm_export/test_vm_export.py\` | gating | \`rhel_vm_for_snapshot_with_content\`\`latest_rhel_data_source\` |
| \`tests/infrastructure/instance_types/test_common_vm_instancetype.py\` | gating | \`rhel_vm_for_dedicated_cpu\`\`latest_rhel_data_source\` |
| \`tests/infrastructure/vhostmd/test_vhostmd.py\` | — | \`latest_rhel_data_source\` (direct use; scope was module, now session) |

**Real tests (cluster required)**

These fixtures run at session/collection time. Verify on real clusters:

_Error path (the fix — run on s390x cluster):_
\`\`\`
pytest tests/storage/snapshots/test_snapshots.py --collect-only
pytest tests/storage/vm_export/test_vm_export.py --collect-only
\`\`\`
Expected: session collects without error; VMs boot using RHEL9 preference (no SecureBoot/EFI requirement).

_Happy path (regression — run on amd64/arm64 cluster):_
\`\`\`
pytest tests/storage/snapshots/test_snapshots.py -k test_snapshot
pytest tests/storage/vm_export/test_vm_export.py -m gating
\`\`\`
Expected: RHEL10 preference resolved, VMs boot normally, snapshot/export tests pass."

gh api repos/RedHatQE/openshift-virtualization-tests/pulls/4866/reviews \
  --method POST \
  --field commit_id="09f94f1bf475dcce7de6c613eadbdbba4d7b7cd6" \
  --field event="COMMENT" \
  --field body="" \
  --field "comments[][path]=tests/conftest.py" \
  --field "comments[][position]=5" \
  --field "comments[][body]=$BODY"

Length of output: 4280



@openshift-virtualization-qe-bot-3

Copy link
Copy Markdown
Contributor

Clean rebase detected — no code changes compared to previous head (09f94f1).
The following labels were preserved: verified, commented-coderabbitai[bot].

The rhel_vm_for_snapshot and rhel_vm_for_snapshot_with_content fixtures
hardcode RHEL10_PREFERENCE which enables SecureBoot. On s390x, SecureBoot
is unsupported (no EFI OVMF ROMs), causing VM boot failures.

Replace hardcoded RHEL10 preference and data source with dynamic lookup
via py_config["latest_instance_type_rhel_os_dict"], which resolves to
RHEL9 on s390x (no SecureBoot) and RHEL10 on amd64/arm64.

Add latest_rhel_data_source_scope_session fixture to tests/conftest.py
that dynamically selects the data source based on architecture.

Signed-off-by: Jathavedhan M <jathavedhan.m@ibm.com>
Co-authored-by: Alexander Mamani Yucra <alexander.mamani@ibm.com>
@openshift-virtualization-qe-bot-5

Copy link
Copy Markdown

Clean rebase detected — no code changes compared to previous head (8e7c9cd).
The following labels were preserved: verified, commented-coderabbitai[bot].

@openshift-virtualization-qe-bot-3

Copy link
Copy Markdown
Contributor

/retest all

Auto-triggered: Files in this PR were modified by merged PR #4808.

Overlapping files

tests/conftest.py

@openshift-virtualization-qe-bot-3

Copy link
Copy Markdown
Contributor

/retest all

Auto-triggered: Files in this PR were modified by merged PR #5167.

Overlapping files

tests/conftest.py

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.