Skip to content

Add tests for activation key with multiple content view environments#20745

Merged
jnagare-redhat merged 8 commits intoSatelliteQE:masterfrom
jnagare-redhat:multicv_lce_activation_key
Feb 11, 2026
Merged

Add tests for activation key with multiple content view environments#20745
jnagare-redhat merged 8 commits intoSatelliteQE:masterfrom
jnagare-redhat:multicv_lce_activation_key

Conversation

@jnagare-redhat
Copy link
Contributor

@jnagare-redhat jnagare-redhat commented Feb 9, 2026

Problem Statement

New MutiCV feature added for Activation key.

Solution

Add tests for activation key with multiple content view environments

test_positive_multi_lce_with_single_cv:
Validates that an activation key can have the same content view assigned to
multiple lifecycle environments. Creates a single content view, promotes it
to two different lifecycle environments, and verifies the activation key can
be configured with both CV/LCE combinations (CV1+LCE1, CV1+LCE2).

test_positive_multi_lce_with_multi_cv:
Validates that an activation key can have multiple content views assigned to
multiple lifecycle environments. Creates three different content views, each
promoted to a different lifecycle environment, and verifies the activation key
can be configured with all three unique CV/LCE combinations (CV1+LCE1, CV2+LCE2,
CV3+LCE3).

Related Issues

Airgun PR :SatelliteQE/airgun#2305
Automating https://issues.redhat.com/browse/SAT-30913

PRT test Cases example

trigger: test-robottelo
pytest: tests/foreman/ui/test_activationkey.py -k "test_positive_multi_lce_with_single_cv or test_positive_multi_lce_with_multi_cv"
airgun: 2305

Summary by Sourcery

Add UI tests validating activation keys can associate content views with multiple lifecycle environments.

Tests:

  • Add coverage for activation keys using a single content view across multiple lifecycle environments.
  • Add coverage for activation keys using multiple content views across multiple lifecycle environments in a single key.

@jnagare-redhat jnagare-redhat requested a review from a team as a code owner February 9, 2026 06:34
@jnagare-redhat jnagare-redhat added No-CherryPick PR doesnt need CherryPick to previous branches Stream Introduced in or relating directly to Satellite Stream/Master pre-commit.ci autofix labels Feb 9, 2026
@sourcery-ai
Copy link
Contributor

sourcery-ai bot commented Feb 9, 2026

Reviewer's Guide

Adds two UI test cases that validate activation key behavior when assigning content views across multiple lifecycle environments, covering both single-CV/multi-LCE and multi-CV/multi-LCE scenarios.

File-Level Changes

Change Details Files
Add test that an activation key can assign the same content view to multiple lifecycle environments
  • Generate random names for activation key, lifecycle environments, and content view
  • Create first custom repository, publish a content view, and promote it to the first lifecycle environment
  • Create a second custom repository, lifecycle environment, and update the content view to include the new repository
  • Publish a new content view version and promote it to the second lifecycle environment
  • Create an activation key bound to the first CV/LCE combination and then update it to add the second combination via the UI session
  • Read activation key details and assert there are exactly two content view environment assignments matching the expected CV/LCE pairs
tests/foreman/ui/test_activationkey.py
Add test that an activation key can assign multiple content views each to different lifecycle environments
  • Generate random names for activation key, three lifecycle environments, and three content views
  • Create three custom repositories and corresponding content views, each published and promoted to a distinct lifecycle environment
  • Create an activation key with the first CV/LCE combination, then update it twice to add the second and third CV/LCE combinations via the UI session
  • Read activation key details and assert there are exactly three content view environment assignments matching the expected CV/LCE pairs
tests/foreman/ui/test_activationkey.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

Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

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 setup for creating/publishing/promoting content views and lifecycle environments is duplicated across both tests; consider extracting a small helper to keep this logic consistent and easier to maintain.
  • In both tests you index session.activationkey.search(name)[0] without checking the list length; adding an explicit assertion that a single result is returned before indexing would make the tests more robust and clearer when they fail.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The setup for creating/publishing/promoting content views and lifecycle environments is duplicated across both tests; consider extracting a small helper to keep this logic consistent and easier to maintain.
- In both tests you index `session.activationkey.search(name)[0]` without checking the list length; adding an explicit assertion that a single result is returned before indexing would make the tests more robust and clearer when they fail.

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.

@jnagare-redhat
Copy link
Contributor Author

trigger: test-robottelo
pytest: tests/foreman/ui/test_activationkey.py -k "test_positive_multi_lce_with_single_cv or test_positive_multi_lce_with_multi_cv"
airgun: 2305

@jnagare-redhat jnagare-redhat added the PRT-Passed Indicates that latest PRT run is passed for the PR label Feb 9, 2026
Copy link
Contributor

@LadislavVasina1 LadislavVasina1 left a comment

Choose a reason for hiding this comment

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

Small changes requested, otherwise looks good.

Co-authored-by: Ladislav Vašina <ladislavvasina@gmail.com>
@Satellite-QE Satellite-QE removed the PRT-Passed Indicates that latest PRT run is passed for the PR label Feb 9, 2026
Co-authored-by: Ladislav Vašina <ladislavvasina@gmail.com>
@jnagare-redhat
Copy link
Contributor Author

trigger: test-robottelo
pytest: tests/foreman/ui/test_activationkey.py -k "test_positive_multi_lce_with_single_cv or test_positive_multi_lce_with_multi_cv"
airgun: 2305

@vijaysawant
Copy link
Contributor

Suggested. cosmetic changes which will not break execution flow

@jnagare-redhat
Copy link
Contributor Author

trigger: test-robottelo
pytest: tests/foreman/ui/test_activationkey.py -k "test_positive_multi_lce_with_single_cv or test_positive_multi_lce_with_multi_cv"
airgun: 2305

@jnagare-redhat
Copy link
Contributor Author

Small changes requested, otherwise looks good.

Updated

@jnagare-redhat jnagare-redhat added the PRT-Passed Indicates that latest PRT run is passed for the PR label Feb 9, 2026
@Satellite-QE Satellite-QE removed the PRT-Passed Indicates that latest PRT run is passed for the PR label Feb 10, 2026
@jnagare-redhat
Copy link
Contributor Author

trigger: test-robottelo
pytest: tests/foreman/ui/test_activationkey.py -k "test_positive_multi_lce_with_single_cv or test_positive_multi_lce_with_multi_cv"
airgun: 2305

Copy link
Contributor

@vijaysawant vijaysawant left a comment

Choose a reason for hiding this comment

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

LGTM

@jnagare-redhat
Copy link
Contributor Author

trigger: test-robottelo
pytest: tests/foreman/ui/test_activationkey.py -k "test_positive_multi_lce_with_single_cv or test_positive_multi_lce_with_multi_cv"
airgun: 2305

@jnagare-redhat jnagare-redhat merged commit 23e4381 into SatelliteQE:master Feb 11, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

No-CherryPick PR doesnt need CherryPick to previous branches Stream Introduced in or relating directly to Satellite Stream/Master

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants