Skip to content

[6.19.z] Add test for Katello 11637 - #20862

Merged
Satellite-QE merged 1 commit into
6.19.zfrom
cherry-pick-6.19.z-b63db29008c99e58249bccc22cd2b912c3d356a5
Feb 26, 2026
Merged

[6.19.z] Add test for Katello 11637#20862
Satellite-QE merged 1 commit into
6.19.zfrom
cherry-pick-6.19.z-b63db29008c99e58249bccc22cd2b912c3d356a5

Conversation

@Satellite-QE

@Satellite-QE Satellite-QE commented Feb 25, 2026

Copy link
Copy Markdown
Collaborator

Cherrypick of PR: #20860

This PR adds test coverage for Katello/katello#11637, which a bug found in the initial multicv host implementation in which changing the content view in a host's content view environment to a different content view in the same lifecycle environment did not function properly.

Requires SatelliteQE/airgun#2321.

Summary by Sourcery

Tests:

  • Add an automated UI test that registers a host and verifies its content view can be reassigned to another content view in the same lifecycle environment, covering SAT-25846.

@Satellite-QE Satellite-QE added 6.19.z Auto_Cherry_Picked Automatically cherrypicked PR using GHA No-CherryPick PR doesnt need CherryPick to previous branches labels Feb 25, 2026
@Satellite-QE

Copy link
Copy Markdown
Collaborator Author
trigger: test-robottelo
pytest: tests/foreman/ui/test_host.py::test_assign_different_cv_from_same_env
airgun: 2321

@Satellite-QE Satellite-QE added the AutoMerge_Cherry_Picked The cherrypicked PRs of master PR would be automerged if all checks passing label Feb 25, 2026
@sourcery-ai

sourcery-ai Bot commented Feb 25, 2026

Copy link
Copy Markdown
Contributor

Reviewer's Guide

Adds a new end-to-end UI test to verify that a host can be reassigned to a different content view within the same lifecycle environment, covering the Katello 11637 bugfix scenario.

File-Level Changes

Change Details Files
Add UI test that registers a host, creates and promotes a second content view in the same lifecycle environment, and verifies the host can be switched to that new content view via the content view environments modal.
  • Introduce pytest test test_assign_different_cv_from_same_env with appropriate markers for RHEL version matching and container exclusion.
  • Create an activation key tied to an existing content view and library environment, then register a RHEL content host using it.
  • Create and sync a new repository, create a new content view, associate the repository, publish it, and promote its version to the target lifecycle environment.
  • Open a UI session, select the organization, and use the host page flow to switch the host’s associated content view to the newly created content view.
  • Retrieve the host’s content view environments via the UI helper and assert the content view matches the newly created one.
tests/foreman/ui/test_host.py

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@sourcery-ai sourcery-ai 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.

Hey - I've left some high level feedback:

  • The activation key is created against module_org.library.id while the second content view is promoted to module_lce, which doesn’t match the test docstring steps describing a new lifecycle environment; consider aligning the AK environment and registration path with module_lce to more accurately exercise the multicv-in-same-LCE scenario.
  • When asserting the assigned content view via get_content_view_envs(...)[0], the test assumes the first returned environment is the one under test; filtering by the specific lifecycle environment instead of indexing would make the assertion more robust if multiple environments are present.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The activation key is created against `module_org.library.id` while the second content view is promoted to `module_lce`, which doesn’t match the test docstring steps describing a new lifecycle environment; consider aligning the AK environment and registration path with `module_lce` to more accurately exercise the multicv-in-same-LCE scenario.
- When asserting the assigned content view via `get_content_view_envs(...)[0]`, the test assumes the first returned environment is the one under test; filtering by the specific lifecycle environment instead of indexing would make the assertion more robust if multiple environments are present.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@LadislavVasina1

Copy link
Copy Markdown
Contributor

trigger: test-robottelo
pytest: tests/foreman/ui/test_host.py::test_assign_different_cv_from_same_env
airgun: 2322

@Satellite-QE

Copy link
Copy Markdown
Collaborator Author

PRT Result

Build Number: 14445
Build Status: UNSTABLE
PRT Comment: pytest tests/foreman/ui/test_host.py::test_assign_different_cv_from_same_env --external-logging
Test Result : ================= 1 failed, 13 warnings in 1179.23s (0:19:39) ==================

@Satellite-QE Satellite-QE added the PRT-Failed Indicates that latest PRT run is failed for the PR label Feb 25, 2026
@synkd

synkd commented Feb 25, 2026

Copy link
Copy Markdown
Contributor
trigger: test-robottelo
pytest: tests/foreman/ui/test_host.py::test_assign_different_cv_from_same_env
airgun: 2322

@Satellite-QE

Copy link
Copy Markdown
Collaborator Author

PRT Result

Build Number: 14485
Build Status: UNSTABLE
PRT Comment: pytest tests/foreman/ui/test_host.py::test_assign_different_cv_from_same_env --external-logging
Test Result : ================= 1 failed, 13 warnings in 1129.91s (0:18:49) ==================

@synkd

synkd commented Feb 25, 2026

Copy link
Copy Markdown
Contributor

This PR is passing when I check it out and run it locally. I'll try debugging in the CI environment tomorrow.

@synkd
synkd force-pushed the cherry-pick-6.19.z-b63db29008c99e58249bccc22cd2b912c3d356a5 branch from f6d5e53 to f8a15e2 Compare February 26, 2026 15:00
@synkd

synkd commented Feb 26, 2026

Copy link
Copy Markdown
Contributor
trigger: test-robottelo
pytest: tests/foreman/ui/test_host.py::test_assign_different_cv_from_same_env
airgun: 2322

2 similar comments
@synkd

synkd commented Feb 26, 2026

Copy link
Copy Markdown
Contributor
trigger: test-robottelo
pytest: tests/foreman/ui/test_host.py::test_assign_different_cv_from_same_env
airgun: 2322

@synkd

synkd commented Feb 26, 2026

Copy link
Copy Markdown
Contributor
trigger: test-robottelo
pytest: tests/foreman/ui/test_host.py::test_assign_different_cv_from_same_env
airgun: 2322

@Satellite-QE

Copy link
Copy Markdown
Collaborator Author

PRT Result

Build Number: 14518
Build Status: SUCCESS
PRT Comment: pytest tests/foreman/ui/test_host.py::test_assign_different_cv_from_same_env --external-logging
Test Result : ================= 1 passed, 18 warnings in 3051.71s (0:50:51) ==================

@Satellite-QE Satellite-QE added PRT-Passed Indicates that latest PRT run is passed for the PR and removed PRT-Failed Indicates that latest PRT run is failed for the PR labels Feb 26, 2026
@synkd
synkd force-pushed the cherry-pick-6.19.z-b63db29008c99e58249bccc22cd2b912c3d356a5 branch from dc1fc11 to 702513f Compare February 26, 2026 19:11
@Satellite-QE Satellite-QE removed the PRT-Passed Indicates that latest PRT run is passed for the PR label Feb 26, 2026
This PR adds test coverage for Katello/katello#11637,
which a bug found in the initial multicv host implementation in which changing
the content view in a host's content view environment to a different content
view in the same lifecycle environment did not function properly.

Requires SatelliteQE/airgun#2321.

(cherry picked from commit b63db29)
@synkd
synkd force-pushed the cherry-pick-6.19.z-b63db29008c99e58249bccc22cd2b912c3d356a5 branch from 702513f to e5d5ce6 Compare February 26, 2026 19:16
@synkd

synkd commented Feb 26, 2026

Copy link
Copy Markdown
Contributor

PRT run 14518 passed when I stepped through the test with epdb. Kicking off another run to see if there is possibly a timing issue that accounts for the discrepancy between debug and non-debug runs.

@synkd

synkd commented Feb 26, 2026

Copy link
Copy Markdown
Contributor
trigger: test-robottelo
pytest: tests/foreman/ui/test_host.py::test_assign_different_cv_from_same_env
airgun: 2322

@Satellite-QE

Copy link
Copy Markdown
Collaborator Author

PRT Result

Build Number: 14520
Build Status: SUCCESS
PRT Comment: pytest tests/foreman/ui/test_host.py::test_assign_different_cv_from_same_env --external-logging
Test Result : ================= 1 passed, 13 warnings in 2221.03s (0:37:01) ==================

@Satellite-QE Satellite-QE added the PRT-Passed Indicates that latest PRT run is passed for the PR label Feb 26, 2026
@Satellite-QE
Satellite-QE merged commit 391ed62 into 6.19.z Feb 26, 2026
12 checks passed
@Satellite-QE
Satellite-QE deleted the cherry-pick-6.19.z-b63db29008c99e58249bccc22cd2b912c3d356a5 branch February 26, 2026 20:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

6.19.z Auto_Cherry_Picked Automatically cherrypicked PR using GHA AutoMerge_Cherry_Picked The cherrypicked PRs of master PR would be automerged if all checks passing No-CherryPick PR doesnt need CherryPick to previous branches PRT-Passed Indicates that latest PRT run is passed for the PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants