Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixed subscription list test case #17382

Closed
wants to merge 1 commit into from

Conversation

vijaysawant
Copy link
Contributor

@vijaysawant vijaysawant commented Jan 20, 2025

Problem Statement

Test case test_positive_access_with_non_admin_user_with_manifest was failing due to Error
TypeError: 'NoneType' object is not subscriptable

Solution

Collect the list of all available scriptions from the page and iterate over each till matches default subscription name

Airgun PR

SatelliteQE/airgun#1702

PRT test Cases example

trigger: test-robottelo
pytest: tests/foreman/ui/test_subscription.py -k 'test_positive_access_with_non_admin_user_with_manifest'
airgun: 1702

@vijaysawant vijaysawant added UI Issues and PRs involving the UI TestFailure Issues and PRs related to a test failing in automation 6.16.z Introduced in or relating directly to Satellite 6.16 labels Jan 20, 2025
@vijaysawant
Copy link
Contributor Author

trigger: test-robottelo
pytest: tests/foreman/ui/test_subscription.py -k 'test_positive_access_with_non_admin_user_with_manifest'
airgun: 1702

@vijaysawant vijaysawant added the No-CherryPick PR doesnt need CherryPick to previous branches label Jan 20, 2025
@Satellite-QE
Copy link
Collaborator

PRT Result

Build Number: 9934
Build Status: SUCCESS
PRT Comment: pytest tests/foreman/ui/test_subscription.py -k test_positive_access_with_non_admin_user_with_manifest --external-logging
Test Result : =========== 1 passed, 7 deselected, 16 warnings in 721.34s (0:12:01) ===========

@Satellite-QE Satellite-QE added the PRT-Passed Indicates that latest PRT run is passed for the PR label Jan 20, 2025
@vijaysawant vijaysawant marked this pull request as ready for review January 20, 2025 10:53
@vijaysawant vijaysawant requested a review from a team as a code owner January 20, 2025 10:53
Copy link
Contributor

@vsedmik vsedmik left a comment

Choose a reason for hiding this comment

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

One proposal and question

Comment on lines 214 to 219
for subscription in all_subscriptions:
if subscription['Name'] == DEFAULT_SUBSCRIPTION_NAME:
assert True
break
else:
pytest.fail(f"{DEFAULT_SUBSCRIPTION_NAME} not found..!")
Copy link
Contributor

Choose a reason for hiding this comment

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

This should do the same I think (haven't tried locally though)

Suggested change
for subscription in all_subscriptions:
if subscription['Name'] == DEFAULT_SUBSCRIPTION_NAME:
assert True
break
else:
pytest.fail(f"{DEFAULT_SUBSCRIPTION_NAME} not found..!")
assert any(sub['Name'] == DEFAULT_SUBSCRIPTION_NAME for sub in all_subscriptions)

Btw, why didn't the original search work? I'm guessing it should return just one result (if the subscription is present).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Original search doesn't work, I changed UI selector and tried, but again when we are on page, view not able to click on Search button.

Copy link
Contributor

@sambible sambible left a comment

Choose a reason for hiding this comment

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

These test changes shouldn't be necessary with the proper airgun fixes I've suggested.

@Satellite-QE Satellite-QE removed the PRT-Passed Indicates that latest PRT run is passed for the PR label Jan 20, 2025
@vijaysawant
Copy link
Contributor Author

trigger: test-robottelo
pytest: tests/foreman/ui/test_subscription.py -k 'test_positive_access_with_non_admin_user_with_manifest'
airgun: 1702

@Satellite-QE
Copy link
Collaborator

PRT Result

Build Number: 9944
Build Status: SUCCESS
PRT Comment: pytest tests/foreman/ui/test_subscription.py -k test_positive_access_with_non_admin_user_with_manifest --external-logging
Test Result : ========== 1 passed, 7 deselected, 18 warnings in 1762.06s (0:29:22) ===========

@Satellite-QE Satellite-QE added the PRT-Passed Indicates that latest PRT run is passed for the PR label Jan 21, 2025
@vijaysawant
Copy link
Contributor Author

These changes are no longer needed, as per @sambible suggestion making changes in airgun view of subscription SatelliteQE/airgun#1702 and changes are working absolutely fine.
So closing this PR.

@vijaysawant
Copy link
Contributor Author

trigger: test-robottelo
pytest: tests/foreman/ui/test_subscription.py -k 'test_positive_access_with_non_admin_user_with_manifest'
airgun: 1702

@vijaysawant vijaysawant reopened this Jan 22, 2025
@vijaysawant
Copy link
Contributor Author

trigger: test-robottelo
pytest: tests/foreman/ui/test_subscription.py -k 'test_positive_access_with_non_admin_user_with_manifest'
airgun: 1702

@Satellite-QE
Copy link
Collaborator

PRT Result

Build Number: 9950
Build Status: UNSTABLE
PRT Comment: pytest tests/foreman/ui/test_subscription.py -k test_positive_access_with_non_admin_user_with_manifest --external-logging
Test Result : =========== 1 failed, 7 deselected, 16 warnings in 647.00s (0:10:47) ===========

@Satellite-QE Satellite-QE added PRT-Failed Indicates that latest PRT run is failed for the PR and removed PRT-Passed Indicates that latest PRT run is passed for the PR labels Jan 22, 2025
@vijaysawant
Copy link
Contributor Author

trigger: test-robottelo
pytest: tests/foreman/ui/test_subscription.py -k 'test_positive_access_with_non_admin_user_with_manifest'
airgun: 1702

@Satellite-QE
Copy link
Collaborator

PRT Result

Build Number: 9951
Build Status: UNSTABLE
PRT Comment: pytest tests/foreman/ui/test_subscription.py -k test_positive_access_with_non_admin_user_with_manifest --external-logging
Test Result : =========== 1 failed, 7 deselected, 16 warnings in 671.70s (0:11:11) ===========

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
6.16.z Introduced in or relating directly to Satellite 6.16 No-CherryPick PR doesnt need CherryPick to previous branches PRT-Failed Indicates that latest PRT run is failed for the PR TestFailure Issues and PRs related to a test failing in automation UI Issues and PRs involving the UI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants