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

[RFE] [ActivationKeys] Update tests to be SCA-compliant #14753

Merged
merged 9 commits into from
Jul 26, 2024

Conversation

ColeHiggins2
Copy link
Member

SCA is now the default in 6.16. This PR is for updating all tests under the Activation Key Component
SAT-24352

@ColeHiggins2 ColeHiggins2 self-assigned this Apr 11, 2024
@ColeHiggins2 ColeHiggins2 requested a review from a team as a code owner April 11, 2024 19:54
@ColeHiggins2 ColeHiggins2 marked this pull request as draft April 11, 2024 19:54
@ColeHiggins2 ColeHiggins2 marked this pull request as ready for review April 22, 2024 14:54
@ColeHiggins2 ColeHiggins2 added RFE Issues that are requesting an enhancement to robottelo No-CherryPick PR doesnt need CherryPick to previous branches Stream Introduced in or relating directly to Satellite Stream/Master labels Apr 22, 2024
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.

Looks good, just left a few comments. PRT pending.

tests/foreman/ui/test_activationkey.py Outdated Show resolved Hide resolved
tests/foreman/cli/test_activationkey.py Outdated Show resolved Hide resolved
@vsedmik
Copy link
Contributor

vsedmik commented Apr 26, 2024

trigger: test-robottelo
pytest: tests/foreman/api/test_activationkey.py tests/foreman/cli/test_activationkey.py tests/foreman/ui/test_activationkey.py -k 'test_positive_fetch_product_content or test_positive_create_with_name or test_positive_create_with_usage_limit_finite or test_positive_create_content_and_check_enabled or test_positive_update_usage_limit_to_finite_number or test_positive_update_usage_limit_to_unlimited or test_positive_add_redhat_product or test_positive_add_redhat_and_custom_products or test_create_ak_with_syspurpose_set or test_update_ak_with_syspurpose_values or test_positive_copy_activationkey_and_check_content or test_positive_view_content_by_non_admin_user or test_positive_end_to_end_register or test_positive_update_rh_product or test_positive_add_rh_product or test_positive_add_custom_product or test_positive_add_rh_and_custom_products or test_positive_fetch_product_content or test_positive_add_multiple_aks_to_system or test_positive_service_level_subscription_with_custom_product'

@Satellite-QE
Copy link
Collaborator

PRT Result

Build Number: 6706
Build Status: UNSTABLE
PRT Comment: pytest tests/foreman/api/test_activationkey.py tests/foreman/cli/test_activationkey.py tests/foreman/ui/test_activationkey.py -k test_positive_fetch_product_content or test_positive_create_with_name or test_positive_create_with_usage_limit_finite or test_positive_create_content_and_check_enabled or test_positive_update_usage_limit_to_finite_number or test_positive_update_usage_limit_to_unlimited or test_positive_add_redhat_product or test_positive_add_redhat_and_custom_products or test_create_ak_with_syspurpose_set or test_update_ak_with_syspurpose_values or test_positive_copy_activationkey_and_check_content or test_positive_view_content_by_non_admin_user or test_positive_end_to_end_register or test_positive_update_rh_product or test_positive_add_rh_product or test_positive_add_custom_product or test_positive_add_rh_and_custom_products or test_positive_fetch_product_content or test_positive_add_multiple_aks_to_system or test_positive_service_level_subscription_with_custom_product --external-logging
Test Result : === 7 failed, 27 passed, 211 deselected, 604 warnings in 2231.37s (0:37:11) ====

@Satellite-QE Satellite-QE added the PRT-Failed Indicates that latest PRT run is failed for the PR label Apr 26, 2024
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.

Ack

  • IMHO, make activation-key tests SCA-compliant and in another PR, take remaning things like, use of global registration template method.
  • I will leave up to author rather to include all changes in same PR or make separate PR for that.

@@ -611,11 +605,11 @@ def test_positive_fetch_product_content(target_sat, function_entitlement_manifes
organization=org, repository=[rh_repo_id, custom_repo.id]
).create()
cv.publish()
ak = target_sat.api.ActivationKey(content_view=cv, organization=org).create()
cvv = cv.read().version[0].read()
cvv.promote(data={'environment_ids': lce.id, 'force': True})
Copy link
Contributor

Choose a reason for hiding this comment

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

Use of 'force': True is require during promotion?

@vsedmik
Copy link
Contributor

vsedmik commented May 16, 2024

@ColeHiggins2 can you rebase? I think the GR is solved by #14034 merged 3 days ago.

@ColeHiggins2 ColeHiggins2 requested a review from a team as a code owner May 21, 2024 14:27
@ColeHiggins2 ColeHiggins2 requested a review from vsedmik May 21, 2024 14:28
@ColeHiggins2
Copy link
Member Author

trigger: test-robottelo
pytest: tests/foreman/api/test_activationkey.py tests/foreman/cli/test_activationkey.py tests/foreman/ui/test_activationkey.py -k 'test_positive_fetch_product_content or test_positive_create_with_name or test_positive_create_with_usage_limit_finite or test_positive_create_content_and_check_enabled or test_positive_update_usage_limit_to_finite_number or test_positive_update_usage_limit_to_unlimited or test_positive_add_redhat_product or test_positive_add_redhat_and_custom_products or test_create_ak_with_syspurpose_set or test_update_ak_with_syspurpose_values or test_positive_copy_activationkey_and_check_content or test_positive_view_content_by_non_admin_user or test_positive_end_to_end_register or test_positive_update_rh_product or test_positive_add_rh_product or test_positive_add_custom_product or test_positive_add_rh_and_custom_products or test_positive_fetch_product_content or test_positive_add_multiple_aks_to_system or test_positive_service_level_subscription_with_custom_product'

@Satellite-QE
Copy link
Collaborator

PRT Result

Build Number: 7034
Build Status: UNSTABLE
PRT Comment: pytest tests/foreman/api/test_activationkey.py tests/foreman/cli/test_activationkey.py tests/foreman/ui/test_activationkey.py -k test_positive_fetch_product_content or test_positive_create_with_name or test_positive_create_with_usage_limit_finite or test_positive_create_content_and_check_enabled or test_positive_update_usage_limit_to_finite_number or test_positive_update_usage_limit_to_unlimited or test_positive_add_redhat_product or test_positive_add_redhat_and_custom_products or test_create_ak_with_syspurpose_set or test_update_ak_with_syspurpose_values or test_positive_copy_activationkey_and_check_content or test_positive_view_content_by_non_admin_user or test_positive_end_to_end_register or test_positive_update_rh_product or test_positive_add_rh_product or test_positive_add_custom_product or test_positive_add_rh_and_custom_products or test_positive_fetch_product_content or test_positive_add_multiple_aks_to_system or test_positive_service_level_subscription_with_custom_product --external-logging
Test Result : === 3 failed, 36 passed, 226 deselected, 1118 warnings in 4322.74s (1:12:02) ===

@ColeHiggins2
Copy link
Member Author

trigger: test-robottelo
pytest: tests/foreman/api/test_activationkey.py tests/foreman/cli/test_activationkey.py tests/foreman/ui/test_activationkey.py -k 'test_positive_fetch_product_content or test_positive_create_with_name or test_positive_create_with_usage_limit_finite or test_positive_create_content_and_check_enabled or test_positive_update_usage_limit_to_finite_number or test_positive_update_usage_limit_to_unlimited or test_positive_add_redhat_product or test_positive_add_redhat_and_custom_products or test_create_ak_with_syspurpose_set or test_update_ak_with_syspurpose_values or test_positive_copy_activationkey_and_check_content or test_positive_view_content_by_non_admin_user or test_positive_end_to_end_register or test_positive_update_rh_product or test_positive_add_rh_product or test_positive_add_custom_product or test_positive_add_rh_and_custom_products or test_positive_fetch_product_content or test_positive_add_multiple_aks_to_system or test_positive_service_level_subscription_with_custom_product'

@Satellite-QE
Copy link
Collaborator

PRT Result

Build Number: 7046
Build Status: UNSTABLE
PRT Comment: pytest tests/foreman/api/test_activationkey.py tests/foreman/cli/test_activationkey.py tests/foreman/ui/test_activationkey.py -k test_positive_fetch_product_content or test_positive_create_with_name or test_positive_create_with_usage_limit_finite or test_positive_create_content_and_check_enabled or test_positive_update_usage_limit_to_finite_number or test_positive_update_usage_limit_to_unlimited or test_positive_add_redhat_product or test_positive_add_redhat_and_custom_products or test_create_ak_with_syspurpose_set or test_update_ak_with_syspurpose_values or test_positive_copy_activationkey_and_check_content or test_positive_view_content_by_non_admin_user or test_positive_end_to_end_register or test_positive_update_rh_product or test_positive_add_rh_product or test_positive_add_custom_product or test_positive_add_rh_and_custom_products or test_positive_fetch_product_content or test_positive_add_multiple_aks_to_system or test_positive_service_level_subscription_with_custom_product --external-logging
Test Result : === 31 passed, 226 deselected, 935 warnings, 8 errors in 3778.73s (1:02:58) ====

@ColeHiggins2
Copy link
Member Author

trigger: test-robottelo
pytest: tests/foreman/api/test_activationkey.py tests/foreman/cli/test_activationkey.py tests/foreman/ui/test_activationkey.py -k 'test_positive_fetch_product_content or test_positive_create_with_name or test_positive_create_with_usage_limit_finite or test_positive_create_content_and_check_enabled or test_positive_update_usage_limit_to_finite_number or test_positive_update_usage_limit_to_unlimited or test_positive_add_redhat_product or test_positive_add_redhat_and_custom_products or test_create_ak_with_syspurpose_set or test_update_ak_with_syspurpose_values or test_positive_copy_activationkey_and_check_content or test_positive_view_content_by_non_admin_user or test_positive_end_to_end_register or test_positive_update_rh_product or test_positive_add_rh_product or test_positive_add_custom_product or test_positive_add_rh_and_custom_products or test_positive_fetch_product_content or test_positive_add_multiple_aks_to_system or test_positive_service_level_subscription_with_custom_product'

@Satellite-QE
Copy link
Collaborator

PRT Result

Build Number: 7072
Build Status: UNSTABLE
PRT Comment: pytest tests/foreman/api/test_activationkey.py tests/foreman/cli/test_activationkey.py tests/foreman/ui/test_activationkey.py -k test_positive_fetch_product_content or test_positive_create_with_name or test_positive_create_with_usage_limit_finite or test_positive_create_content_and_check_enabled or test_positive_update_usage_limit_to_finite_number or test_positive_update_usage_limit_to_unlimited or test_positive_add_redhat_product or test_positive_add_redhat_and_custom_products or test_create_ak_with_syspurpose_set or test_update_ak_with_syspurpose_values or test_positive_copy_activationkey_and_check_content or test_positive_view_content_by_non_admin_user or test_positive_end_to_end_register or test_positive_update_rh_product or test_positive_add_rh_product or test_positive_add_custom_product or test_positive_add_rh_and_custom_products or test_positive_fetch_product_content or test_positive_add_multiple_aks_to_system or test_positive_service_level_subscription_with_custom_product --external-logging
Test Result : === 33 passed, 226 deselected, 987 warnings, 6 errors in 3464.05s (0:57:44) ====

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.

There are still some unresolved comments above and the CI/CQ fails with

  * Enumerated list ends without a blank line; unexpected unindent.

      :steps:
          1. Create a custom repo
    >     2. Create ak and add custom repo to ak
          4. Register a rhel6 chost with the ak

Can you address the comments and fix the CI/CQ?

@ColeHiggins2
Copy link
Member Author

trigger: test-robottelo
pytest: tests/foreman/api/test_activationkey.py tests/foreman/cli/test_activationkey.py tests/foreman/ui/test_activationkey.py -k 'test_positive_fetch_product_content or test_positive_create_with_name or test_positive_create_with_usage_limit_finite or test_positive_create_content_and_check_enabled or test_positive_update_usage_limit_to_finite_number or test_positive_update_usage_limit_to_unlimited or test_positive_add_redhat_product or test_positive_add_redhat_and_custom_products or test_create_ak_with_syspurpose_set or test_update_ak_with_syspurpose_values or test_positive_copy_activationkey_and_check_content or test_positive_view_content_by_non_admin_user or test_positive_end_to_end_register or test_positive_update_rh_product or test_positive_add_rh_product or test_positive_add_custom_product or test_positive_add_rh_and_custom_products or test_positive_fetch_product_content or test_positive_add_multiple_aks_to_system or test_positive_service_level_subscription_with_custom_product'

@Satellite-QE
Copy link
Collaborator

PRT Result

Build Number: 7760
Build Status: UNSTABLE
PRT Comment: pytest tests/foreman/api/test_activationkey.py tests/foreman/cli/test_activationkey.py tests/foreman/ui/test_activationkey.py -k test_positive_fetch_product_content or test_positive_create_with_name or test_positive_create_with_usage_limit_finite or test_positive_create_content_and_check_enabled or test_positive_update_usage_limit_to_finite_number or test_positive_update_usage_limit_to_unlimited or test_positive_add_redhat_product or test_positive_add_redhat_and_custom_products or test_create_ak_with_syspurpose_set or test_update_ak_with_syspurpose_values or test_positive_copy_activationkey_and_check_content or test_positive_view_content_by_non_admin_user or test_positive_end_to_end_register or test_positive_update_rh_product or test_positive_add_rh_product or test_positive_add_custom_product or test_positive_add_rh_and_custom_products or test_positive_fetch_product_content or test_positive_add_multiple_aks_to_system or test_positive_service_level_subscription_with_custom_product --external-logging
Test Result : = 3 failed, 33 passed, 228 deselected, 1039 warnings, 6 errors in 3831.60s (1:03:51) =

@Satellite-QE
Copy link
Collaborator

PRT Result

Build Number: 7771
Build Status: UNSTABLE
PRT Comment: pytest tests/foreman/api/test_activationkey.py tests/foreman/cli/test_activationkey.py tests/foreman/ui/test_activationkey.py -k test_positive_fetch_product_content or test_positive_create_with_name or test_positive_create_with_usage_limit_finite or test_positive_create_content_and_check_enabled or test_positive_update_usage_limit_to_finite_number or test_positive_update_usage_limit_to_unlimited or test_positive_add_redhat_product or test_positive_add_redhat_and_custom_products or test_create_ak_with_syspurpose_set or test_update_ak_with_syspurpose_values or test_positive_copy_activationkey_and_check_content or test_positive_view_content_by_non_admin_user or test_positive_end_to_end_register or test_positive_update_rh_product or test_positive_add_rh_product or test_positive_add_custom_product or test_positive_add_rh_and_custom_products or test_positive_fetch_product_content or test_positive_add_multiple_aks_to_system or test_positive_service_level_subscription_with_custom_product --external-logging
Test Result : = 3 failed, 34 passed, 228 deselected, 1109 warnings, 5 errors in 4145.84s (1:09:05) =

@ColeHiggins2
Copy link
Member Author

trigger: test-robottelo
pytest: tests/foreman/api/test_activationkey.py tests/foreman/cli/test_activationkey.py tests/foreman/ui/test_activationkey.py -k 'test_positive_fetch_product_content or test_positive_create_with_name or test_positive_create_with_usage_limit_finite or test_positive_create_content_and_check_enabled or test_positive_update_usage_limit_to_finite_number or test_positive_update_usage_limit_to_unlimited or test_positive_add_redhat_product or test_positive_add_redhat_and_custom_products or test_create_ak_with_syspurpose_set or test_update_ak_with_syspurpose_values or test_positive_copy_activationkey_and_check_content or test_positive_view_content_by_non_admin_user or test_positive_end_to_end_register or test_positive_update_rh_product or test_positive_add_rh_product or test_positive_add_custom_product or test_positive_add_rh_and_custom_products or test_positive_fetch_product_content or test_positive_add_multiple_aks_to_system or test_positive_service_level_subscription_with_custom_product'

@ColeHiggins2
Copy link
Member Author

trigger: test-robottelo
pytest: tests/foreman/api/test_activationkey.py tests/foreman/cli/test_activationkey.py tests/foreman/ui/test_activationkey.py -k 'test_positive_fetch_product_content or test_positive_create_with_name or test_positive_create_with_usage_limit_finite or test_positive_create_content_and_check_enabled or test_positive_update_usage_limit_to_finite_number or test_positive_update_usage_limit_to_unlimited or test_positive_add_redhat_product or test_positive_add_redhat_and_custom_products or test_create_ak_with_syspurpose_set or test_update_ak_with_syspurpose_values or test_positive_copy_activationkey_and_check_content or test_positive_view_content_by_non_admin_user or test_positive_end_to_end_register or test_positive_update_rh_product or test_positive_add_rh_product or test_positive_add_custom_product or test_positive_add_rh_and_custom_products or test_positive_fetch_product_content or test_positive_add_multiple_aks_to_system or test_positive_service_level_subscription_with_custom_product'

@Satellite-QE
Copy link
Collaborator

PRT Result

Build Number: 7855
Build Status: SUCCESS
PRT Comment: pytest tests/foreman/api/test_activationkey.py tests/foreman/cli/test_activationkey.py tests/foreman/ui/test_activationkey.py -k test_positive_fetch_product_content or test_positive_create_with_name or test_positive_create_with_usage_limit_finite or test_positive_create_content_and_check_enabled or test_positive_update_usage_limit_to_finite_number or test_positive_update_usage_limit_to_unlimited or test_positive_add_redhat_product or test_positive_add_redhat_and_custom_products or test_create_ak_with_syspurpose_set or test_update_ak_with_syspurpose_values or test_positive_copy_activationkey_and_check_content or test_positive_view_content_by_non_admin_user or test_positive_end_to_end_register or test_positive_update_rh_product or test_positive_add_rh_product or test_positive_add_custom_product or test_positive_add_rh_and_custom_products or test_positive_fetch_product_content or test_positive_add_multiple_aks_to_system or test_positive_service_level_subscription_with_custom_product --external-logging
Test Result : ======== 39 passed, 228 deselected, 1178 warnings in 4626.52s (1:17:06) ========

@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 Jul 25, 2024
@Satellite-QE
Copy link
Collaborator

PRT Result

Build Number: 7856
Build Status: UNSTABLE
PRT Comment: pytest tests/foreman/api/test_activationkey.py tests/foreman/cli/test_activationkey.py tests/foreman/ui/test_activationkey.py -k test_positive_fetch_product_content or test_positive_create_with_name or test_positive_create_with_usage_limit_finite or test_positive_create_content_and_check_enabled or test_positive_update_usage_limit_to_finite_number or test_positive_update_usage_limit_to_unlimited or test_positive_add_redhat_product or test_positive_add_redhat_and_custom_products or test_create_ak_with_syspurpose_set or test_update_ak_with_syspurpose_values or test_positive_copy_activationkey_and_check_content or test_positive_view_content_by_non_admin_user or test_positive_end_to_end_register or test_positive_update_rh_product or test_positive_add_rh_product or test_positive_add_custom_product or test_positive_add_rh_and_custom_products or test_positive_fetch_product_content or test_positive_add_multiple_aks_to_system or test_positive_service_level_subscription_with_custom_product --external-logging
Test Result : === 1 failed, 38 passed, 228 deselected, 1593 warnings in 6275.38s (1:44:35) ===

@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 Jul 25, 2024
@ColeHiggins2
Copy link
Member Author

trigger: test-robottelo
pytest: tests/foreman/cli/test_activationkey.py -k test_positive_add_custom_product

@Satellite-QE
Copy link
Collaborator

PRT Result

Build Number: 7874
Build Status: SUCCESS
PRT Comment: pytest tests/foreman/cli/test_activationkey.py -k test_positive_add_custom_product --external-logging
Test Result : ========= 1 passed, 143 deselected, 152 warnings in 786.58s (0:13:06) ==========

@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 Jul 26, 2024
@Satellite-QE Satellite-QE removed the PRT-Passed Indicates that latest PRT run is passed for the PR label Jul 26, 2024
@ColeHiggins2
Copy link
Member Author

Seems like a duplicate uuid made its way in to master causing code quality failures. I updated the test in repository.py to fix it.

@vsedmik vsedmik merged commit bb133df into SatelliteQE:master Jul 26, 2024
8 checks passed
jyejare pushed a commit to jyejare/robottelo that referenced this pull request Oct 19, 2024
…14753)

* Updating AK to SCA Only

* Updating AK api test for sca only

* Fixing UI tests

* update to function instead of module

* Addressing comments and updating errors

* Updating function target sat to target sat

* Updating typo enumerated list

* Adding markers for prt

* fixing pr runner failures
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 RFE Issues that are requesting an enhancement to robottelo Stream Introduced in or relating directly to Satellite Stream/Master
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants