Skip to content

fix Future Dated Subs Test - #20873

Merged
jameerpathan111 merged 3 commits into
SatelliteQE:masterfrom
LadislavVasina1:fixFutureDateSubsTest
Feb 26, 2026
Merged

fix Future Dated Subs Test#20873
jameerpathan111 merged 3 commits into
SatelliteQE:masterfrom
LadislavVasina1:fixFutureDateSubsTest

Conversation

@LadislavVasina1

@LadislavVasina1 LadislavVasina1 commented Feb 25, 2026

Copy link
Copy Markdown
Contributor
  • Fix future-dated subscription UI test by ensuring the manifest is uploaded within the test rather than implicitly in the fixture.
trigger: test-robottelo
pytest: tests/foreman/ui/test_subscription.py -k "test_positive_populate_future_date_subcription"

Summary by Sourcery

Ensure future-dated subscription UI tests explicitly upload the manifest during the test rather than implicitly via a fixture.

Bug Fixes:

  • Correct future-dated subscription UI test setup by uploading the manifest within the test using the provided manifest content.

Enhancements:

  • Simplify the future-dated subscription manifest fixture by returning the manifest context and removing the implicit upload dependency on the target Satellite.

@sourcery-ai

sourcery-ai Bot commented Feb 25, 2026

Copy link
Copy Markdown
Contributor
Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Adjusts the future-dated subscription manifest fixture to only create/yield the manifest and moves the manifest upload into the specific UI test, making the test responsible for uploading the manifest it depends on.

Sequence diagram for future-dated subscription manifest handling in UI test

sequenceDiagram
    participant Pytest
    participant Test as test_positive_populate_future_date_subcription
    participant Fixture as func_future_dated_subscription_manifest
    participant Manifester
    participant Org as function_org
    participant Sat as target_sat

    Pytest->>Test: Execute test
    Test->>Fixture: Request future_dated_subscription_manifest
    activate Fixture
    Fixture->>Manifester: __enter__(manifest_category=future_date_subscription)
    activate Manifester
    Manifester-->>Fixture: manifest (content)
    deactivate Manifester
    Fixture-->>Test: yield manifest
    deactivate Fixture

    Test->>Sat: upload_manifest(org_id=Org.id, content=manifest.content)
    Sat-->>Test: upload result

    Test->>Test: Perform UI steps validating future-dated subscription
    Test-->>Pytest: Test result

    activate Manifester
    Test->>Manifester: __exit__()
    deactivate Manifester
Loading

File-Level Changes

Change Details Files
Decouple manifest creation from upload in the future-dated subscription fixture.
  • Remove dependency on target_sat from the func_future_dated_subscription_manifest fixture
  • Change the fixture to yield the manifest context instead of uploading it
  • Leave responsibility for upload to the test or caller
pytest_fixtures/component/taxonomy.py
Make the future-dated subscription UI test explicitly upload its own manifest.
  • Call target_sat.upload_manifest with the organization id and manifest content at the start of the test
  • Rely on the existing UI session flow to verify the manifest is present
tests/foreman/ui/test_subscription.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

@LadislavVasina1

Copy link
Copy Markdown
Contributor Author
trigger: test-robottelo
pytest: tests/foreman/ui/test_subscription.py -k "test_positive_populate_future_date_subcription"

@jameerpathan111 jameerpathan111 added CherryPick PR needs CherryPick to previous branches AutoMerge_Cherry_Picked The cherrypicked PRs of master PR would be automerged if all checks passing Stream Introduced in or relating directly to Satellite Stream/Master 6.19.z labels Feb 25, 2026
Comment thread pytest_fixtures/component/taxonomy.py Outdated
@LadislavVasina1

Copy link
Copy Markdown
Contributor Author

trigger: test-robottelo
pytest: tests/foreman/ui/test_subscription.py -k "test_positive_populate_future_date_subcription"

@LadislavVasina1
LadislavVasina1 marked this pull request as ready for review February 26, 2026 06:42
@LadislavVasina1
LadislavVasina1 requested review from a team as code owners February 26, 2026 06:42
@LadislavVasina1 LadislavVasina1 changed the title fixFutureDateSubsTest fix Future Dated Subs Test Feb 26, 2026

@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 func_future_dated_subscription_manifest docstring still says 'Create and upload...' but the fixture now only provides the manifest object; update the description to match the new behavior.
  • Consider renaming func_future_dated_subscription_manifest to something that reflects it now just supplies a manifest (and no longer uploads it) to make its side effects clearer at call sites.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The `func_future_dated_subscription_manifest` docstring still says 'Create and upload...' but the fixture now only provides the manifest object; update the description to match the new behavior.
- Consider renaming `func_future_dated_subscription_manifest` to something that reflects it now just supplies a manifest (and no longer uploads it) to make its side effects clearer at call sites.

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 LadislavVasina1 added the PRT-Passed Indicates that latest PRT run is passed for the PR label Feb 26, 2026
@jameerpathan111
jameerpathan111 merged commit fdaa318 into SatelliteQE:master Feb 26, 2026
9 checks passed
github-actions Bot pushed a commit that referenced this pull request Feb 26, 2026
* fixFutureDateSubsTest

* Address comment

* changeFunctionComment

(cherry picked from commit fdaa318)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

6.19.z AutoMerge_Cherry_Picked The cherrypicked PRs of master PR would be automerged if all checks passing CherryPick PR needs CherryPick to previous branches PRT-Passed Indicates that latest PRT run is passed for the PR Stream Introduced in or relating directly to Satellite Stream/Master

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants