Skip to content

fix(warm): restrict ClusterRole tests to vSphere provider only - #574

Merged
krcmarik merged 1 commit into
RedHatQE:mainfrom
AmenB:fix/clusterrole-vsphere-only
Jul 2, 2026
Merged

krcmarik merged 1 commit into
RedHatQE:mainfrom
AmenB:fix/clusterrole-vsphere-only

Conversation

@AmenB

@AmenB AmenB commented Jul 2, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Add @pytest.mark.vsphere to both ClusterRole test classes
  • The SCC requirement for forklift-migrator-role is vSphere-specific — on RHV the migration succeeds without SCC, causing the negative test to incorrectly fail
  • The existing pytest_collection_modifyitems hook auto-skips items with the vsphere keyword for non-vSphere providers

Summary by CodeRabbit

  • Tests
    • Added vSphere test coverage to two warm cluster role migration test scenarios, including both the SCC and non-SCC variants.

The SCC requirement for forklift-migrator-role is vSphere-specific.
On RHV, migration succeeds without SCC binding, causing the negative
test (TestClusterroleWarmMtvMigration) to incorrectly fail. Add
@pytest.mark.vsphere to both ClusterRole test classes so they are
auto-skipped for non-vSphere providers via pytest_collection_modifyitems.
@coderabbitai

coderabbitai Bot commented Jul 2, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

Walkthrough

Added the @pytest.mark.vsphere decorator to two test configurations in the warm clusterrole migration test file, applied before existing marker configurations for both the non-SCC and SCC test variants.

Changes

Test marker addition

Layer / File(s) Summary
Add vsphere marker to warm migration tests
tests/warm/test_mtv_warm_clusterrole_migration.py
Added @pytest.mark.vsphere decorator to two warm clusterrole migration test configurations (without SCC and with SCC), placed before existing remote/tier/warm/incremental marker decorators.

Estimated code review effort: 1 (Trivial) | ~2 minutes

Related PRs: None identified.

Suggested labels: test, ci

Suggested reviewers: None identified.

CRITICAL: None — this is a purely additive marker change with zero logic impact, so there's nothing here that can break a build or leak a secret. LOW: Verify the vsphere marker is registered in pytest config (e.g., pytest.ini or pyproject.toml) — an unregistered marker won't fail tests but may emit a PytestUnknownMarkWarning, which is the kind of silent noise that erodes trust in your test output over time.

Poem
A rabbit hops through warm migration code,
Two markers added, light is the load,
"vsphere" now tags where once there was none,
Small change, quick review, and the job is done. 🐇

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.
Title check ✅ Passed The title clearly matches the change: it restricts the ClusterRole warm tests to the vSphere provider.
✨ 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.

@redhat-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: Disabled for this repository
  • 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: All label categories are enabled (default configuration)

📋 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)
  • /automerge - Enable automatic merging when all requirements are met (maintainers and 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 conventional-title - Validate commit message format
  • /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. Status Checks: All required status checks must pass
  3. No Blockers: No wip, hold, has-conflicts labels and PR must be mergeable (no conflicts)
  4. Verified: PR must be marked as verified

📊 Review Process

Approvers and Reviewers

Approvers:

  • krcmarik
  • myakove
  • solenoci

Reviewers:

  • krcmarik
  • myakove
  • solenoci
Available Labels
  • hold
  • verified
  • wip
  • lgtm
  • approve
  • automerge
AI Features
  • Conventional Title: Mode: fix (claude/claude-opus-4-6-1m)
  • Cherry-Pick Conflict Resolution: Enabled (claude/claude-opus-4-6-1m)
  • Test Oracle: Triggers: approved (cursor/gpt-5.4-xhigh-fast); /test-oracle can be used anytime
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

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

@qodo-code-review

Copy link
Copy Markdown

PR Summary by Qodo

Restrict ClusterRole warm-migration tests to vSphere provider

🐞 Bug fix 🧪 Tests 🕐 10-20 Minutes

Grey Divider

AI Description

• Mark ClusterRole warm-migration tests as vSphere-only to prevent false failures on RHV.
• Leverage existing collection hook to auto-skip vsphere tests for non-vSphere providers.
• Align negative SCC expectations with provider-specific behavior for forklift-migrator-role.
Diagram

graph TD
  A["Pytest run"] --> B["Collect tests"] --> C{"Provider is vSphere?"}
  C -->|Yes| D["Run ClusterRole tests"]
  C -->|No| E["Auto-skip @pytest.mark.vsphere tests"]
Loading
High-Level Assessment

The following are alternative approaches to this PR:

1. Inline conditional skip (skipif) inside each test/class
  • ➕ Makes the provider constraint explicit at the test site
  • ➕ Does not rely on collection-time keyword/marker behavior
  • ➖ More repetitive if many tests need the same provider guard
  • ➖ Provider detection logic may need to be imported into multiple modules
2. Split provider-specific tests into a vSphere-only test module/folder
  • ➕ Clear physical separation of provider-specific suites
  • ➕ Enables targeted test selection by path in CI
  • ➖ May require broader refactoring and moving files
  • ➖ Less convenient if tests share fixtures/helpers with provider-agnostic suites

Recommendation: Keep the current approach (marking the two ClusterRole test classes with @pytest.mark.vsphere) because it matches existing infrastructure (pytest_collection_modifyitems) and fixes the RHV false-negative with minimal disruption. The alternatives add boilerplate or restructuring without clear additional benefit for this scope.

Files changed (1) +2 / -0

Tests (1) +2 / -0
test_mtv_warm_clusterrole_migration.pyMark ClusterRole warm-migration test classes as vSphere-only +2/-0

Mark ClusterRole warm-migration test classes as vSphere-only

• Adds '@pytest.mark.vsphere' to both ClusterRole warm migration test classes. This ensures the suite is auto-skipped for non-vSphere providers (e.g., RHV) where the SCC-negative expectation is not valid.

tests/warm/test_mtv_warm_clusterrole_migration.py

@qodo-code-review

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)

Grey Divider

Great, no issues found!

Qodo reviewed your code and found no material issues that require review

Grey Divider

Qodo Logo

@redhat-qe-bot redhat-qe-bot changed the title Restrict ClusterRole tests to vSphere provider only fix(warm): restrict ClusterRole tests to vSphere provider only Jul 2, 2026
@AmenB

AmenB commented Jul 2, 2026

Copy link
Copy Markdown
Contributor Author

/verified

@krcmarik

krcmarik commented Jul 2, 2026 •

Copy link
Copy Markdown
Collaborator

/lgtm
/approve

@krcmarik
krcmarik enabled auto-merge (squash) July 2, 2026 22:51
@krcmarik

krcmarik commented Jul 2, 2026

Copy link
Copy Markdown
Collaborator

/approve

@krcmarik
krcmarik merged commit c7e8f6c into RedHatQE:main Jul 2, 2026
9 checks passed
@rh-bot-1

rh-bot-1 commented Jul 2, 2026

Copy link
Copy Markdown

New container for ghcr.io/redhatqe/mtv-api-tests:latest published

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