-
Notifications
You must be signed in to change notification settings - Fork 114
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
[Comp Eval] Updating fixture to SCA and Fixing failing tests #14167
[Comp Eval] Updating fixture to SCA and Fixing failing tests #14167
Conversation
and it contains created host with correct data | ||
|
||
:CaseImportance: High | ||
""" | ||
# generate Host Status report | ||
os_name = 'comma,' + gen_string('alpha') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The comma was there to test correct handling in CSV.
with target_sat.ui_session() as session: | ||
session.organization.select(module_org.name) | ||
session.location.select(module_location.name) | ||
# create multiple hosts to test filtering |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So you removed testing filtering. It may be ok. Do you test it elsewhere? Is the change intended? You haven't mentioned it. This weakens the test.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was failing so I just decided to use the new way of registering a host. This test is for report templates not host filtering, unless the report templates test filter, I dont think its necessary to keep? what do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I also see some ui test for testing positive user access with host filtering, is that the same thing here?
trigger: test-robottelo |
PRT Result
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few proposals and questions posed
)[0] | ||
ak.add_subscriptions(data={'quantity': 1, 'subscription_id': subscription.id}) | ||
all_content = ak.product_content(data={'content_access_mode_all': '1'})['results'] | ||
content_label = content_label = [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
content_label = content_label = [ | |
content_label = [ |
client.install_katello_ca(target_sat) | ||
org, ak, _, _ = setup_content | ||
client.register_contenthost(org.label, ak.name) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use global registration
client.install_katello_ca(target_sat) | |
org, ak, _, _ = setup_content | |
client.register_contenthost(org.label, ak.name) | |
org, ak, _, _ = setup_content | |
client.register(org, None, ak.name, target_sat) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ColeHiggins2 Based on the latest discussion in Automation Weekly BS call, this became rather a blocker than suggestion. Can you update the registering method?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated
@@ -490,10 +481,12 @@ def test_negative_nonauthor_of_report_cant_download_it(session): | |||
|
|||
|
|||
@pytest.mark.tier3 | |||
@pytest.mark.no_containers | |||
def test_positive_gen_entitlements_reports_multiple_formats( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking at org.sca_disable()
bellow, is this test case really applicable to 6.16? Shouldn't it be raised against 6.15.z
branch instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change fixes the test in 6.15 and will be removed in 6.16. however, a lot of the other work in this PR still applies to 6.16. so I will just create a separate PR to remove this later in 6.16 as part of the RFE for SCA ONLY
5443215
to
8624785
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ack
Can you please check this small change?
8624785
to
dd3591e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1 change necessary, looks good otherwise. Can we get PRT as well
query={'search': f'name="{DEFAULT_SUBSCRIPTION_NAME}"'} | ||
)[0] | ||
ak.add_subscriptions(data={'quantity': 1, 'subscription_id': subscription.id}) | ||
client.register_contenthost(org.label, None, ak.name, target_sat) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to change this to use global registration as well
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One more suggestion from me. Sam's comment regarding GR and PRT run (at least for the first test since the second one would fail in stream) pending.
def test_positive_generate_registered_hosts_report( | ||
session, target_sat, setup_content, rhel7_contenthost | ||
): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's get rid of rhelX_contenthost
in favor of rhel_contenthost
and parametrize what version we want to test with. Here I would say we could test with all supported versions (as suggested bellow), or pick one at least.
def test_positive_generate_registered_hosts_report( | |
session, target_sat, setup_content, rhel7_contenthost | |
): | |
@pytest.mark.rhel_ver_match(r'^(?!6$)\d+$') | |
def test_positive_generate_registered_hosts_report( | |
session, target_sat, module_setup_content, rhel_contenthost | |
): |
I can see the setup_content
fixture is module-scoped - good, we need it module-scoped so we don't create new and new content for every parametrized run, just consider renaming it to what it is - module_setup_content
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ack.. lgtm
Penidng few comments of other reviewers and PRT status, please take a look.
dd3591e
to
7aac374
Compare
@pytest.mark.upgrade | ||
@pytest.mark.tier2 | ||
def test_positive_generate_registered_hosts_report(target_sat, module_org, module_location): | ||
def test_positive_generate_registered_hosts_report( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lets run PRT on this at least, if that looks good I'm good with ACK
trigger: test-robottelo |
PRT Result
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
* Fixing tests for reporting comp eval * updating to list comp * addressing comments * Addressing comments * addressing comments and rename setup content (cherry picked from commit 06e5529)
…teQE#14167) * Fixing tests for reporting comp eval * updating to list comp * addressing comments * Addressing comments * addressing comments and rename setup content
Problem Statement
Many tests were failing in the UI due to several issues including outdated code, old non-sca fixtures, and more.
The associated issues were addressed and now passing
RHSAT6-45606: test_positive_generate_all_installed_packages_report
RHSAT6-44209: test_positive_gen_entitlements_reports_multiple_formats
RHSAT6-40833: test_positive_generate_registered_hosts_report
Solution
Update setup_content fixture to use SCA and enabled the custom repo on the Activation Key
docstring changes and manual org.disable for subscription-entitlements report
Rewrite outdated test using new rhel_content fixture