Skip to content

infra: Update dv_for_data_source to create the dv from public quay#5592

Open
RoniKishner wants to merge 2 commits into
RedHatQE:mainfrom
RoniKishner:cirros-import
Open

infra: Update dv_for_data_source to create the dv from public quay#5592
RoniKishner wants to merge 2 commits into
RedHatQE:mainfrom
RoniKishner:cirros-import

Conversation

@RoniKishner

@RoniKishner RoniKishner commented Jul 12, 2026

Copy link
Copy Markdown
Contributor
What this PR does / why we need it:
  • Updates dv_for_data_source in test_ssp_data_sources.py to create the DataVolume from a public Quay registry (using Images.Fedora via DEFAULT_FEDORA_REGISTRY_URL) instead of an Artifactory-hosted HTTP image, removing the dependency on Artifactory.
  • Decrease the wait timeout for verifying the DataSource does not change reference, since the testing environments are more stable now and can manage to finish the import in less then 5 minutes.
Which issue(s) this PR fixes:
Special notes for reviewer:
jira-ticket:

https://redhat.atlassian.net/browse/CNV-86274

Summary by CodeRabbit

  • Tests
    • Updated golden-image validation to use registry-based data sources.
    • Reduced the wait time for verifying that referenced volumes remain unchanged.
    • Improved test setup reliability by creating data sources with appropriate administrative access.

@coderabbitai

coderabbitai Bot commented Jul 12, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

The golden image update tests now create DataVolumes from Fedora registry sources, remove Artifactory resource handling, shorten referenced-volume verification waits, and construct scoped DataSource fixtures with admin_client.

Changes

Golden image data source updates

Layer / File(s) Summary
Registry-based DataVolume creation
tests/infrastructure/golden_images/update_boot_source/test_ssp_data_sources.py
DataVolume sources now use registry constants and Fedora’s default size; Artifactory helpers, imports, and cleanup are removed.
Unchanged-volume wait timeout
tests/infrastructure/golden_images/update_boot_source/test_ssp_data_sources.py
Referenced-volume verification now waits for TIMEOUT_30SEC instead of TIMEOUT_10MIN.
Admin DataSource fixture client
tests/infrastructure/golden_images/update_boot_source/test_ssp_data_sources.py
Scoped DataSource construction now uses admin_client.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

Suggested labels: new-tests

Suggested reviewers: dshchedr, mijankow, geetikakay, rnetser, vsibirsk

🚥 Pre-merge checks | ✅ 6
✅ Passed checks (6 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Stp Link Required ✅ Passed No new test files or new test_* functions were added; only existing test helpers/fixtures were modified in place.
Stp Scenario Coverage ✅ Passed No module/class/test docstring in the modified test file references an STP URL, and repo-wide tests search found none, so STP scenario coverage is not applicable.
Title check ✅ Passed The title is under 120 characters and accurately summarizes the registry-based DV source change.
Description check ✅ Passed The description follows the required template and covers the change, issue section, reviewer notes, and Jira link.
✨ 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.

@openshift-virtualization-qe-bot

Copy link
Copy Markdown

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
  • /security-override - Set security check runs to pass (maintainers only)
  • /security-override cancel - Re-run security checks

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
  • /cherry-pick-retry <branch> - Retry a failed cherry-pick (merged PRs only)

Branch Management

  • /rebase - Rebase this PR branch onto its base branch

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
  • myakove
  • rnetser
  • vsibirsk

Reviewers:

  • RoniKishner
  • dshchedr
  • geetikakay
  • mijankow
  • rnetser
  • vsibirsk
Available Labels
  • hold
  • verified
  • wip
  • lgtm
  • approve
AI Features
  • Cherry-Pick Conflict Resolution: Enabled (claude/claude-opus-4-6-1m)
Security Checks
  • Suspicious Path Detection: Monitors paths: .claude/, .vscode/, .cursor/, .devcontainer/, .pi/, .github/workflows/, .github/actions/
  • Committer Identity Check: Verifies last committer matches PR author
  • Mandatory: Security checks block merge (use /security-override to bypass — maintainers only)

💡 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

📌 Additional Information

Custom Commands:

  • /test-plan — Triggers CodeRabbit to analyze the PR's changed files and post a test execution plan
  • /rerun-smoke — Adds retest-smoke label on the PR to trigger smoke tests execution

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

@RoniKishner

Copy link
Copy Markdown
Contributor Author

/test-plan

@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"

@coderabbitai

coderabbitai Bot commented Jul 12, 2026

Copy link
Copy Markdown
Contributor

Tip

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

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail
gh pr diff 5592 --repo RedHatQE/openshift-virtualization-tests > /tmp/pr.diff
echo "---- FILES CHANGED ----"
gh pr diff 5592 --repo RedHatQE/openshift-virtualization-tests --name-only
echo "---- DIFF ----"
cat /tmp/pr.diff

Length of output: 2270


🏁 Script executed:

#!/bin/bash
set -euo pipefail
gh pr diff 5592 --repo RedHatQE/openshift-virtualization-tests --name-only
echo "---- DIFF ----"
gh pr diff 5592 --repo RedHatQE/openshift-virtualization-tests

Length of output: 2207


@openshift-virtualization-qe-bot-3: I'm unable to complete the test execution plan request — repository cloning failed with an authentication error (Invalid username or token. Password authentication is not supported for Git operations.) on both attempts. This is a credentials/access issue with the shell sandbox for RedHatQE/openshift-virtualization-tests, not a transient failure, so retrying the same operation won't help.

Based on the PR objectives alone (without being able to inspect the actual diff/fixtures/markers), I can note:

  • The change is confined to test_ssp_data_sources.py (the dv_for_data_source fixture and a wait-timeout reduction from 10 to 5 minutes) — this appears to be test-logic-only, not a utilities//libs/ change, so no transitive smoke/gating impact analysis via shared utilities is expected. However, I cannot verify this without repository access.

Please check the sandbox's Git credentials/token configuration for this repository so I can retry cloning and produce the full inline Test Execution Plan.

coderabbitai[bot]
coderabbitai Bot previously approved these changes Jul 12, 2026
@RoniKishner

Copy link
Copy Markdown
Contributor Author

/verified
ttest_ssp_data_sources.py

@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"

@coderabbitai

coderabbitai Bot commented Jul 12, 2026

Copy link
Copy Markdown
Contributor
🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail
echo "---- AUTH STATUS ----"
gh auth status 2>&1 || true
echo "---- PR DIFF ----"
gh pr diff 5592 --repo RedHatQE/openshift-virtualization-tests --name-only 2>&1 || true
gh pr diff 5592 --repo RedHatQE/openshift-virtualization-tests 2>&1 || true
echo "---- LOCAL FILE CHECK ----"
fd test_ssp_data_sources.py

Length of output: 2355


@openshift-virtualization-qe-bot-3: The repository clone is still failing with the same authentication error (Invalid username or token. Password authentication is not supported for Git operations.) for RedHatQE/openshift-virtualization-tests. This is a persistent credentials/token issue on the sandbox side, not a transient failure — retrying the identical command again will not help.

Additionally, I should clarify: this chat-based response channel can only produce a text reply in this comment thread; it cannot submit a separate inline review comment on a specific diff line of the "Files Changed" tab. Posting an inline PR review comment requires the dedicated review flow (e.g., triggered via or), not a conversational reply like this one.

Given the PR objectives, here's the best-effort plan without repository access:

Test Execution Plan

  • Run smoke tests: False — No traced dependency path could be verified (no repo access), and per the PR summary, changes are confined to tests/infrastructure/golden_images/update_boot_source/test_ssp_data_sources.py (test-logic only, no utilities//libs/ changes).
  • Run gating tests: False — Same reasoning; no utilities//libs/ changes to trace.
  • Affected tests to run:
    • tests/infrastructure/golden_images/update_boot_source/test_ssp_data_sources.py — full file, since dv_for_data_source fixture behavior changed (registry source instead of Artifactory) and the DataSource-reference wait timeout was reduced.

Real tests (cluster required) — recommended since this changes runtime image-pull behavior:

  • Happy path: pytest tests/infrastructure/golden_images/update_boot_source/test_ssp_data_sources.py -k data_source — verify DataVolume now imports successfully from the public Quay Fedora registry and the DataSource reference remains unchanged within the new 5-minute window.

Please check the sandbox's Git credentials/token configuration for RedHatQE/openshift-virtualization-tests so cloning can succeed on a future attempt; I cannot resolve this myself.

✅ Action performed

Full review finished.

Comment on lines +49 to +50
source_dict=construct_datavolume_source_dict(source=REGISTRY_STR, url=DEFAULT_FEDORA_REGISTRY_URL),
size=Images.Fedora.DEFAULT_DV_SIZE,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Wouldn't it be better to clone from a golden image to reduce the dependency on quay?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

You mean from a DataSource?
It's not possible, the test idea is to create a DV while the boot sources are down, and then to bring them up again after the PVC is created.
So there no source to clone from when creating the DV.

try:
for sample in TimeoutSampler(
wait_timeout=TIMEOUT_10MIN,
wait_timeout=TIMEOUT_5MIN,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

wait_for_data_source_unchanged_referenced_volume is only used at one place under test_data_source_with_existing_golden_image_pvc.
Before we hit test body, fixtures already settles and verified

  • disable disabled_common_boot_image_import
  • manual DV succeeded, datasources ready on that pvc
  • enabled_common_boot_image_import_feature_gate makes sure that ds, dic,ssp.hco all looks good.
    inside test body ,

wait_for_condition_message_value waits for ready message which means it's stable so instead of wait_for_data_source_unchanged_referenced_volume , which is another wait , should we directly assert? wait_for_data_source_unchanged_referenced_volume will keep polling for 5 mins even if we get what we want . why we expect something would change in that 5 mins because everything is already stable when we run wait_for_data_source_unchanged_referenced_volume

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I have done some investigation, instead of waiting, lets trigger a reconcile.
If the reconcile doesn't change the reference then all is good.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

There are 2 parts to it.

  1. I am unsure why we need a second reconcile introducing new annotations? We already had a reconcile we waited and i believe after reconcile do we want to check other things too?
  2. if ssp really reconcile if that's our aim, we really don't check if that really happened nor we looks for cdi.kubevirt.io/dataImportCron (if that's not there) . However with this check you could hit https://redhat.atlassian.net/browse/CNV-86273

Comment on lines +90 to +94
ResourceEditor(
patches={
data_source: {"metadata": {"annotations": {RECONCILE_TRIGGER_ANNOTATION: RECONCILE_TRIGGER_ANNOTATION}}}
}
).update()

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

this should be context managed?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

At the end of this function the VM is deleted, so it makes no difference if the label is kept, making it context managed means it is calling an API call at the end, which doesn't effect the test.

@geetikakay geetikakay Jul 15, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

There are 2 parts to it.

  1. I am unsure why we need a second reconcile introducing new annotations? We already had a reconcile we waited and i believe after reconcile do we want to check other things too?
  2. if ssp really reconcile if that's our aim, we really don't check if that really happened nor we looks for cdi.kubevirt.io/dataImportCron (if that's not there) . However with this check you could hit redhat.atlassian.net/browse/CNV-86273

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

context manager for clean exit

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

We could check the reconcile action happened by changing a label and waiting for it to be reconciled, previously we didn't really had a reconcile action, we had an action to attach a DV, and just waited 10 minutes.

About the bug, you are correct, but this is a real bug, if we do run into something similar then it means there are issues in the product.

@geetikakay geetikakay Jul 15, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

reconcile did happen in test_data_source_with_existing_golden_image_pvc via enabled_common_boot_image_import_feature_gate when we re-enable it. ssp brings back dic is reconcile action. refer: https://github.com/kubevirt/ssp-operator/blob/main/internal/operands/data-sources/reconcile.go#L129-L132

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yep, you are right, I guess even a timeout of 10 seconds should be enough then, the operator shouldn't really take that long to change anything if it's reconciling already.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

yeah theoretically but give it a try on real cluster similar to where we run scheduled runs.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

After some different tries it looks like the reconcile is called immediately, which takes it about 3-5 seconds to change the field.
I changed the value to 30 seconds, just to make sure, maybe on slow clusters it will take longer.

Signed-off-by: rkishner <rkishner@redhat.com>
@RoniKishner

Copy link
Copy Markdown
Contributor Author

/verified

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In
`@tests/infrastructure/golden_images/update_boot_source/test_ssp_data_sources.py`:
- Around line 44-52: Move dv_for_data_source and
wait_for_data_source_unchanged_referenced_volume from
tests/infrastructure/golden_images/update_boot_source/test_ssp_data_sources.py
(lines 44-52 and 89-89) into
tests/infrastructure/golden_images/update_boot_source/utils.py, adding
Google-format docstrings; move the data_source_by_name_scope_function fixture
from
tests/infrastructure/golden_images/update_boot_source/test_ssp_data_sources.py
(lines 254-255) into
tests/infrastructure/golden_images/update_boot_source/conftest.py, and update
imports or fixture discovery so existing tests continue using them.
🪄 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: a84deea5-c587-4d0e-9b92-b515ad9d56d5

📥 Commits

Reviewing files that changed from the base of the PR and between acbe332 and 5b75ca9.

📒 Files selected for processing (1)
  • tests/infrastructure/golden_images/update_boot_source/test_ssp_data_sources.py
🔗 Linked repositories identified

CodeRabbit considers these linked repositories for cross-repo context during reviews:

  • RedHatQE/openshift-virtualization-tests-design-docs (manual)

Comment on lines 44 to +52
@contextmanager
def dv_for_data_source(name, data_source, admin_client):
artifactory_secret = get_artifactory_secret(namespace=data_source.namespace)
artifactory_config_map = get_artifactory_config_map(namespace=data_source.namespace)
with DataVolume(
client=admin_client,
name=name,
namespace=data_source.namespace,
source_dict=construct_datavolume_source_dict(
# underlying OS is not relevant
source="http",
url=get_http_image_url(image_directory=Images.Cirros.DIR, image_name=Images.Cirros.QCOW2_IMG),
secret_name=artifactory_secret.name,
cert_configmap_name=artifactory_config_map.name,
),
size=Images.Cirros.DEFAULT_DV_SIZE,
# underlying OS is not relevant
source_dict=construct_datavolume_source_dict(source=REGISTRY_STR, url=DEFAULT_FEDORA_REGISTRY_URL),
size=Images.Fedora.DEFAULT_DV_SIZE,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

📐 Maintainability & Code Quality | 🟠 Major | ⚡ Quick win

Move local helpers and fixtures to dedicated modules.

HIGH severity. Defining helper functions and fixtures inside test_*.py files mixes test definitions with test infrastructure. To ensure clean test modules and reusability, they must be separated.

As per coding guidelines: "Do not define helper functions, utility functions, or classes in conftest.py or test_*.py; place them in dedicated utility modules... keep local helpers in <feature_dir>/utils.py, and local fixtures in <feature_dir>/conftest.py."

Please relocate these to their appropriate files. When moving the helpers, ensure they include Google-format docstrings as required for public functions.

  • tests/infrastructure/golden_images/update_boot_source/test_ssp_data_sources.py#L44-L52: Move the dv_for_data_source helper function to <feature_dir>/utils.py.
  • tests/infrastructure/golden_images/update_boot_source/test_ssp_data_sources.py#L89-L89: Move the wait_for_data_source_unchanged_referenced_volume helper function to <feature_dir>/utils.py.
  • tests/infrastructure/golden_images/update_boot_source/test_ssp_data_sources.py#L254-L255: Move the data_source_by_name_scope_function fixture to <feature_dir>/conftest.py.
📍 Affects 1 file
  • tests/infrastructure/golden_images/update_boot_source/test_ssp_data_sources.py#L44-L52 (this comment)
  • tests/infrastructure/golden_images/update_boot_source/test_ssp_data_sources.py#L89-L89
  • tests/infrastructure/golden_images/update_boot_source/test_ssp_data_sources.py#L254-L255
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@tests/infrastructure/golden_images/update_boot_source/test_ssp_data_sources.py`
around lines 44 - 52, Move dv_for_data_source and
wait_for_data_source_unchanged_referenced_volume from
tests/infrastructure/golden_images/update_boot_source/test_ssp_data_sources.py
(lines 44-52 and 89-89) into
tests/infrastructure/golden_images/update_boot_source/utils.py, adding
Google-format docstrings; move the data_source_by_name_scope_function fixture
from
tests/infrastructure/golden_images/update_boot_source/test_ssp_data_sources.py
(lines 254-255) into
tests/infrastructure/golden_images/update_boot_source/conftest.py, and update
imports or fixture discovery so existing tests continue using them.

Source: Coding guidelines

@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"

get_artifactory_secret,
get_http_image_url,
)
from utilities.constants import Images

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Test Execution Plan

  • Run smoke tests: False — the only changed module is marked post_upgrade; it has no smoke marker, and this PR does not modify shared utilities/, libs/, or conftest.py code that could transitively affect smoke coverage.
  • Run gating tests: False — the changed module has no gating marker, and there are no shared-code changes that could affect gating tests.
  • Affected tests to run:
    • tests/infrastructure/golden_images/update_boot_source/test_ssp_data_sources.py::test_upload_dv_for_auto_update_dangling_data_sources (post_upgrade) — exercises data_source_by_name_scope_functionuploaded_dv_for_dangling_data_source_scope_functiondv_for_data_source, including the new public-Quay Fedora registry import.
    • tests/infrastructure/golden_images/update_boot_source/test_ssp_data_sources.py::test_data_source_with_existing_golden_image_pvc (post_upgrade) — exercises data_source_by_name_scope_functioncreated_dv_for_data_import_cron_managed_data_source_scope_functiondv_for_data_source and the reduced unchanged-reference timeout.

Real tests (cluster required)

Error/fix path (public registry import):
pytest tests/infrastructure/golden_images/update_boot_source/test_ssp_data_sources.py::test_upload_dv_for_auto_update_dangling_data_sources
Expected: the Fedora DataVolume imports from public Quay and the DataSource condition reaches the parameterized expected state.

Happy path (existing golden-image PVC):
pytest tests/infrastructure/golden_images/update_boot_source/test_ssp_data_sources.py::test_data_source_with_existing_golden_image_pvc
Expected: the manually created Fedora DataVolume is consumed and the DataSource reference remains unchanged throughout the 30-second verification window.

@coderabbitai

coderabbitai Bot commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Tip

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

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== PR metadata =="
gh pr view 5592 --repo RedHatQE/openshift-virtualization-tests \
  --json headRefOid,baseRefOid,files --jq '{headRefOid, baseRefOid, files: [.files[] | {path, additions, deletions}]}'

echo "== Changed files and zero-context diff =="
git diff --name-only HEAD^ HEAD
git diff --unified=0 HEAD^ HEAD -- tests/infrastructure/golden_images/update_boot_source/test_ssp_data_sources.py

echo "== Module outline =="
ast-grep outline tests/infrastructure/golden_images/update_boot_source/test_ssp_data_sources.py \
  --items all --type function,class --view expanded

echo "== Smoke and gating marker files =="
rg -n -l '`@pytest`\.mark\.(smoke|gating)' tests/ || true

echo "== Existing PR review comments =="
gh api "repos/RedHatQE/openshift-virtualization-tests/pulls/5592/comments?per_page=100" \
  --jq '.[] | {id, path, line, body, user: .user.login}' || true

Length of output: 1762


🏁 Script executed:

#!/bin/bash
set -euo pipefail

repo="RedHatQE/openshift-virtualization-tests"
pr="5592"
sha="5b75ca9c378d3169461d5c1df760bb01a3b52a7c"
path="tests/infrastructure/golden_images/update_boot_source/test_ssp_data_sources.py"

echo "== PR file patch =="
gh api "repos/$repo/pulls/$pr/files?per_page=100" \
  --jq '.[] | select(.filename == "'"$path"'") | {filename, status, patch}'

echo "== Download head version for static inspection =="
gh api "repos/$repo/contents/$path?ref=$sha" \
  -H 'Accept: application/vnd.github.raw' > /tmp/test_ssp_data_sources.py

echo "== AST outline =="
ast-grep outline /tmp/test_ssp_data_sources.py --items all --type function,class --view expanded

echo "== Relevant source (fixtures, test definitions, markers) =="
rg -n -C 4 '^(def |class |`@pytest`\.mark|`@pytest`\.fixture)|\bdv_for_data_source\b|data_source_by_name_scope_function|referenced.*volume|unchanged' \
  /tmp/test_ssp_data_sources.py || true

echo "== Module markers =="
rg -n '`@pytest`\.mark\.(smoke|gating)' /tmp/test_ssp_data_sources.py || true

echo "== Marker files in working tree (continue if unavailable) =="
rg -n -l '`@pytest`\.mark\.smoke' tests/ 2>/dev/null || true
rg -n -l '`@pytest`\.mark\.gating' tests/ 2>/dev/null || true

echo "== Existing inline comments on this file =="
gh api "repos/$repo/pulls/$pr/comments?per_page=100" \
  --jq '.[] | select(.path == "'"$path"'") | {id, commit_id, line, side, body, user: .user.login}' || true

Length of output: 38753


🏁 Script executed:

#!/bin/bash
set -euo pipefail

repo="RedHatQE/openshift-virtualization-tests"
pr="5592"
sha="5b75ca9c378d3169461d5c1df760bb01a3b52a7c"
path="tests/infrastructure/golden_images/update_boot_source/test_ssp_data_sources.py"

body=$(cat <<'EOF'
## Test Execution Plan

- **Run smoke tests: False** — the only changed module is marked `post_upgrade`; it has no `smoke` marker, and this PR does not modify shared `utilities/`, `libs/`, or `conftest.py` code that could transitively affect smoke coverage.
- **Run gating tests: False** — the changed module has no `gating` marker, and there are no shared-code changes that could affect gating tests.
- **Affected tests to run:**
  - `tests/infrastructure/golden_images/update_boot_source/test_ssp_data_sources.py::test_upload_dv_for_auto_update_dangling_data_sources` (`post_upgrade`) — exercises `data_source_by_name_scope_function` → `uploaded_dv_for_dangling_data_source_scope_function` → `dv_for_data_source`, including the new public-Quay Fedora registry import.
  - `tests/infrastructure/golden_images/update_boot_source/test_ssp_data_sources.py::test_data_source_with_existing_golden_image_pvc` (`post_upgrade`) — exercises `data_source_by_name_scope_function` → `created_dv_for_data_import_cron_managed_data_source_scope_function` → `dv_for_data_source` and the reduced unchanged-reference timeout.

**Real tests (cluster required)**

Error/fix path (public registry import):
`pytest tests/infrastructure/golden_images/update_boot_source/test_ssp_data_sources.py::test_upload_dv_for_auto_update_dangling_data_sources`
Expected: the Fedora DataVolume imports from public Quay and the DataSource condition reaches the parameterized expected state.

Happy path (existing golden-image PVC):
`pytest tests/infrastructure/golden_images/update_boot_source/test_ssp_data_sources.py::test_data_source_with_existing_golden_image_pvc`
Expected: the manually created Fedora DataVolume is consumed and the DataSource reference remains unchanged throughout the 30-second verification window.
EOF
)

gh api --method POST "repos/$repo/pulls/$pr/comments" \
  -f body="$body" \
  -f commit_id="$sha" \
  -f path="$path" \
  -F line=20 \
  -f side=RIGHT \
  --jq '{id, path, line, side, commit_id}'

Length of output: 2608


@openshift-virtualization-qe-bot-3

TESTS_AUTO_UPDATE_BOOT_SOURCE_NAME = [*py_config["auto_update_data_source_matrix"][0]][0]
DUMMY_VOLUME_NAME = "dummy"
DATA_SOURCE_MANAGED_BY_CDI_LABEL = f"{DataSource.ApiGroup.CDI_KUBEVIRT_IO}/dataImportCron"
RECONCILE_TRIGGER_ANNOTATION = "reconcile-trigger"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Leftover ?

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.

8 participants