Skip to content

[4.19] Remove obsolete install overhead tests#4683

Open
hmeir wants to merge 1 commit intoRedHatQE:cnv-4.19from
hmeir:4.19-remove-overhead-install
Open

[4.19] Remove obsolete install overhead tests#4683
hmeir wants to merge 1 commit intoRedHatQE:cnv-4.19from
hmeir:4.19-remove-overhead-install

Conversation

@hmeir
Copy link
Copy Markdown
Contributor

@hmeir hmeir commented Apr 30, 2026

Short description:

Cherry-pick from #4652

More details:
What this PR does / why we need it:
Which issue(s) this PR fixes:
Special notes for reviewer:
jira-ticket:

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

Remove the following tests that caused excessive false failures due to
their brittle design based on resource comparison before/after
installation:

- test_cnv_resources_installed_cluster_scoped: Compared cluster-scoped
  resources before/after CNV installation. This test was unreliable
  because cluster resources change dynamically from other operators.

- test_cnv_resources_installed_namespace_scoped: Compared namespaced
  resources before/after CNV installation. This test repeatedly failed
  due to ephemeral resources (Pods, ReplicaSets, PodMetrics, Jobs)
  created by the cluster that were not expected. The allowlist approach
  could never account for all dynamic resource variations across
  different cluster configurations.

Also removed:
- get_all_resources() utility function and related constants (only
  used by the removed tests)
- Resource comparison allowlists that were specific to these tests
- Unused fixtures: installation_data_dir,
  before_installation_all_resources,
  after_installation_all_resources

The remaining tests (test_cnv_installation,
test_cnv_installation_alert_cleanup,
test_cnv_installation_without_hco_cr_alert,
test_cnv_installation_without_hco_cr_metrics,
test_default_storage_class_set) provide sufficient coverage for CNV
installation validation without the brittleness of resource comparison
tests.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Signed-off-by: Harel Meir <hmeir@redhat.com>
@openshift-virtualization-qe-bot-2
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
  • myakove
  • rnetser
  • vsibirsk

Reviewers:

  • OhadRevah
  • RoniKishner
  • albarker-rh
  • dshchedr
  • hmeir
  • rlobillo
  • 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.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 30, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 327ecb72-e966-42e3-afc4-484b01301df1

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ 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.

@rnetser
Copy link
Copy Markdown
Collaborator

rnetser commented May 3, 2026

/approve
/lgtm

@hmeir
Copy link
Copy Markdown
Contributor Author

hmeir commented May 4, 2026

/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 Test Execution Plan with the smoke tests recommendation.
Do NOT submit a formal review - just post the inline comment directly.

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, and fixture inheritance
  5. Detect new tests introduced in the PR
  6. Smoke Test Impact Analysis: Determine if any changes could affect smoke tests by checking:
    • Changes to files/functions used by tests marked with @pytest.mark.smoke
    • Changes to fixtures or utilities imported by smoke tests
    • Changes to conftest.py files that may affect smoke test execution
    • Changes to core infrastructure code (utilities/, libs/) that smoke tests depend on

Your deliverable:
Your change request comment will be based on the following requirements:

Test Execution Plan

  • Run smoke tests: True / False (Based on your smoke test impact analysis - True if any changes may affect smoke tests)
  • 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 specific marker(s) can be used to cover multiple cases.

Guidelines:

  • Include only tests directly affected by the changes
  • Use a full file path only if ALL tests in that file require verification
  • Use file path + test name if only specific tests are needed
  • If a test marker can cover multiple files/tests, provide the marker
  • Balance coverage vs over-testing - Keep descriptions minimal

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 an inline review 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 submitting the review fails 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: Before setting "Run smoke tests: True", you MUST use shell scripts to:
- Trace the actual fixture dependency chain from smoke tests to changed fixtures
- Verify that smoke tests actually import/use changed utilities or functions
- Confirm the dependency path exists; do NOT assume based on scope or semantics
- Be conservative: Session-scoped fixtures or infrastructure-sounding names do NOT
automatically mean smoke test impact. Only flag smoke test impact when you can
demonstrate a concrete dependency path.
WRONG: "This session-scoped storage fixture might affect smoke tests"
RIGHT: "Smoke test X uses fixture Y, which depends on the changed fixture Z"

Comment thread tests/install_upgrade_operators/product_install/conftest.py
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 4, 2026

Tip

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

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Get the list of changed files in PR `#4683`
gh pr view 4683 --repo RedHatQE/openshift-virtualization-tests --json files --jq '.files[].path'
echo "---"
# Get the diff
gh pr diff 4683 --repo RedHatQE/openshift-virtualization-tests

Length of output: 16892


🏁 Script executed:

#!/bin/bash
# Check if any smoke tests reference the removed fixtures/functions/constants
echo "=== Searching for smoke tests referencing removed fixtures ==="
rg -n "before_installation_all_resources|after_installation_all_resources|installation_data_dir|get_all_resources|CLUSTER_RESOURCE_ALLOWLIST|NAMESPACED_RESOURCE_ALLOWLIST|IGNORE_KIND|IGNORE_NAMESPACE|NAMESPACED_IGNORE_KINDS" --type py

echo ""
echo "=== Check for smoke markers in affected test file ==="
rg -n "smoke" tests/install_upgrade_operators/product_install/ --type py

echo ""
echo "=== Check if any other files import from the changed modules ==="
rg -n "from tests.install_upgrade_operators.product_install" --type py

Length of output: 641


🏁 Script executed:

#!/bin/bash
# Get PR head SHA and details for posting inline comment
PR_DATA=$(gh pr view 4683 --repo RedHatQE/openshift-virtualization-tests --json headRefOid,number)
echo "$PR_DATA"

HEAD_SHA=$(echo "$PR_DATA" | jq -r '.headRefOid')
echo "HEAD SHA: $HEAD_SHA"

# Post an inline review comment on the first changed line of conftest.py
# The first changed line is line 2 (removed `import os`) - we'll comment on the surrounding context
# Use GitHub API to create a pull request review with a comment
gh api \
  --method POST \
  -H "Accept: application/vnd.github+json" \
  /repos/RedHatQE/openshift-virtualization-tests/pulls/4683/reviews \
  -f body="" \
  -f commit_id="$HEAD_SHA" \
  -f event="COMMENT" \
  -f "comments[0][path]=tests/install_upgrade_operators/product_install/conftest.py" \
  -F "comments[0][line]=1" \
  -f "comments[0][side]=RIGHT" \
  -f "comments[0][body]=**Test Execution Plan**

- **Run smoke tests: False** *(No smoke tests depend on the removed fixtures, functions, or constants — confirmed via dependency tracing)*
- \`tests/install_upgrade_operators/product_install/test_install_openshift_virtualization.py\` — Verify remaining tests are unaffected by the removal of \`before_installation_all_resources\` fixture and deleted overhead test functions"

Length of output: 1463


🏁 Script executed:

#!/bin/bash
HEAD_SHA="c0e5ea0281b104ca1ea79c43ee8d1d36b94e6c61"

# Use a JSON payload file to properly format the array
cat > /tmp/review_payload.json << 'EOF'
{
  "commit_id": "c0e5ea0281b104ca1ea79c43ee8d1d36b94e6c61",
  "body": "",
  "event": "COMMENT",
  "comments": [
    {
      "path": "tests/install_upgrade_operators/product_install/conftest.py",
      "line": 1,
      "side": "RIGHT",
      "body": "**Test Execution Plan**\n\n- **Run smoke tests: False** *(No smoke tests depend on the removed fixtures, functions, or constants — confirmed via dependency tracing)*\n- `tests/install_upgrade_operators/product_install/test_install_openshift_virtualization.py` — Verify remaining tests are unaffected by the removal of `before_installation_all_resources` fixture and deleted overhead test functions"
    }
  ]
}
EOF

gh api \
  --method POST \
  -H "Accept: application/vnd.github+json" \
  --input /tmp/review_payload.json \
  /repos/RedHatQE/openshift-virtualization-tests/pulls/4683/reviews

Length of output: 1735


@hmeir
Copy link
Copy Markdown
Contributor Author

hmeir commented May 4, 2026

/check-can-merge

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.

6 participants