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

[Test Fix] Updating Tools repo to Utils repo in the recommended repos test #13223

Conversation

ColeHiggins2
Copy link
Member

The Tools repository was removed and is not longer in the recommended repo list. Switching the repository check to use the Utils and Capsule repositories instead

@ColeHiggins2 ColeHiggins2 added Easy Fix :) Easiest Fix to review and quick merge request. CherryPick PR needs CherryPick to previous branches 6.14.z Introduced in or relating directly to Satellite 6.14 6.15.z Introduced in or relating directly to Satellite 6.15 labels Nov 29, 2023
@ColeHiggins2 ColeHiggins2 self-assigned this Nov 29, 2023
@ColeHiggins2 ColeHiggins2 requested a review from a team as a code owner November 29, 2023 15:21
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.

  • Can you please update repo names from :expectedresults: 2? Capsule/Tools would be Capsule/Utils
  • Suggested new variable name, cap_tool_repos would be cap_utils_repos
  • query about assertion statement

One more thing I realised, test would failed in 6.15 due to use of fixture module_entitlement_manifest_org, please use alternative module_sca_manifest_org

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.

Could you please take a look into suggested points? I have given collective feedback.
I can see requested changes have been completed, Ack on basis of that changes.
Please run PRT comment.

@lhellebr
Copy link
Contributor

Please run PRT for affected tests

@vijaysawant
Copy link
Contributor

trigger: test-robottelo
pytest: tests/foreman/ui/test_repository.py -k test_positive_recommended_repos

@@ -942,10 +942,10 @@ def test_positive_recommended_repos(session, module_entitlement_manifest_org):
cap_tool_repos = [
repo['name']
for repo in rrepos_on
if 'Tools' in repo['name'] or 'Capsule' in repo['name']
if 'Utils' in repo['name'] or 'Capsule' in repo['name']
]
cap_tools_repos = [repo for repo in cap_tool_repos if repo.split()[4] != sat_version]
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think instead of checking this for != sat_version, we should verify if n-1 repos are being suggested for capsule and utils repos

Copy link
Member Author

Choose a reason for hiding this comment

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

these repos should always match the sat version. so if any do not, then we throw the error message

Copy link
Contributor

@vijaysawant vijaysawant Feb 6, 2024

Choose a reason for hiding this comment

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

I tested locally, as in updated code for variable cap_utils_main_repos, getting sat_version n-1 value, as you suggested @Gauravtalreja1
We can assert currect sat version and the sat version which found in repo names (in cap_utils_main_repos list) does not same, as per the step number 3

Copy link
Member Author

Choose a reason for hiding this comment

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

The current code is checking that ANY Repository not equal to the current sat version is not there. I don't see a reason to make it ONLY n-1.

Copy link
Collaborator

Choose a reason for hiding this comment

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

yes, I think with n-1 it will be more explicite and efficient assertion here, which would all repositories equal to n-1 versions instead of checking not equal to current sat versions

Copy link
Collaborator

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

@Gauravtalreja1 my observation
On one of older snap version of 6.15 snap 3.0 I had seen 6.14 repos of capsule/maintain/Utils but on latest snap verson of 6.15 snap 9.0 I couldn't see.

Copy link
Contributor

Choose a reason for hiding this comment

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

I believe that on Satellite of version N only the N capsule/maintain/utils repos should be recommended. In other words, N-1, N-2, and all older repos should be missing.
@Gauravtalreja1, can you describe why you propose to check N-1 only?

Copy link
Member Author

Choose a reason for hiding this comment

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

@Gauravtalreja1 my observation On one of older snap version of 6.15 snap 3.0 I had seen 6.14 repos of capsule/maintain/Utils but on latest snap verson of 6.15 snap 9.0 I couldn't see.

This is expected behavior. at some point between snap 3 and 9, 6.14 repos were removed from recommended.

@rplevka
Copy link
Member

rplevka commented Jan 26, 2024

Pending other requester comments

Copy link
Member

@ogajduse ogajduse left a comment

Choose a reason for hiding this comment

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

co-reviewed with @rplevka.

ACK, pending @Gauravtalreja1 and @vijaysawant comments.

@ColeHiggins2 ColeHiggins2 marked this pull request as draft February 2, 2024 14:09
@ColeHiggins2 ColeHiggins2 force-pushed the fixed_recommended_repo_test branch from 364d41c to 49f17a8 Compare February 5, 2024 20:43
@ColeHiggins2 ColeHiggins2 marked this pull request as ready for review February 5, 2024 20:54
@ColeHiggins2 ColeHiggins2 added 6.12.z Introduced in or relating directly to Satellite 6.12 6.13.z Introduced in or relating directly to Satellite 6.13 labels Feb 5, 2024
@ColeHiggins2
Copy link
Member Author

trigger: test-robottelo
pytest: tests/foreman/ui/test_repository.py -k test_positive_recommended_repos

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.

  • As per suggestion from @Gauravtalreja1 and @ogajduse I have tested this PR by making changes locally, working fine.
  • @ColeHiggins2 you need to incorporate the suggested changes
  • run pre-commit
  • force push

@@ -942,10 +942,10 @@ def test_positive_recommended_repos(session, module_entitlement_manifest_org):
cap_tool_repos = [
repo['name']
for repo in rrepos_on
if 'Tools' in repo['name'] or 'Capsule' in repo['name']
if 'Utils' in repo['name'] or 'Capsule' in repo['name']
]
cap_tools_repos = [repo for repo in cap_tool_repos if repo.split()[4] != sat_version]
Copy link
Contributor

@vijaysawant vijaysawant Feb 6, 2024

Choose a reason for hiding this comment

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

I tested locally, as in updated code for variable cap_utils_main_repos, getting sat_version n-1 value, as you suggested @Gauravtalreja1
We can assert currect sat version and the sat version which found in repo names (in cap_utils_main_repos list) does not same, as per the step number 3

@vijaysawant
Copy link
Contributor

vijaysawant commented Feb 13, 2024

trigger: test-robottelo
pytest: tests/foreman/ui/test_repository.py -k test_positive_recommended_repos
env:
ROBOTTELO_server__deploy_workflow: 'deploy-satellite'
ROBOTTELO_server__deploy_arguments__deploy_rhel_version: '8'
ROBOTTELO_server__deploy_arguments__deploy_sat_version: '6.14'

@Satellite-QE
Copy link
Collaborator

PRT Result

Build Number: 5700
Build Status: UNSTABLE
PRT Comment: pytest tests/foreman/ui/test_repository.py -k test_positive_recommended_repos
Test Result : ================ 33 deselected, 10 warnings, 1 error in 49.31s =================

@Satellite-QE Satellite-QE added the PRT-Failed Indicates that latest PRT run is failed for the PR label Feb 13, 2024
@Satellite-QE
Copy link
Collaborator

PRT Result

Build Number: 5701
Build Status: UNSTABLE
PRT Comment: pytest tests/foreman/ui/test_repository.py -k test_positive_recommended_repos
Test Result : ================ 33 deselected, 10 warnings, 1 error in 44.50s =================

@sambible
Copy link
Contributor

trigger: test-robottelo
pytest: tests/foreman/ui/test_repository.py -k test_positive_recommended_repos

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.

logic looks good, will merge when we can see a passing PRT run.

@Satellite-QE
Copy link
Collaborator

PRT Result

Build Number: 5703
Build Status: UNSTABLE
PRT Comment: pytest tests/foreman/ui/test_repository.py -k test_positive_recommended_repos
Test Result : ========== 1 failed, 33 deselected, 12 warnings in 754.63s (0:12:34) ===========

@vijaysawant
Copy link
Contributor

trigger: test-robottelo
pytest: tests/foreman/ui/test_repository.py -k test_positive_recommended_repos
env:
    ROBOTTELO_server__deploy_workflow: 'deploy-satellite'
    ROBOTTELO_server__deploy_arguments__deploy_rhel_version: '8'
    ROBOTTELO_server__deploy_arguments__deploy_sat_version: '6.14'

@Satellite-QE
Copy link
Collaborator

PRT Result

Build Number: 5717
Build Status: UNSTABLE
PRT Comment: pytest tests/foreman/ui/test_repository.py -k test_positive_recommended_repos
Test Result : ================ 33 deselected, 10 warnings, 1 error in 49.73s =================

Copy link
Collaborator

@Gauravtalreja1 Gauravtalreja1 left a comment

Choose a reason for hiding this comment

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

Ack, with one pending comment from earlier, let me know what you think

@vsedmik
Copy link
Contributor

vsedmik commented Feb 15, 2024

trigger: test-robottelo
pytest: tests/foreman/ui/test_repository.py -k test_positive_recommended_repos
env:
  ROBOTTELO_server__deploy_workflow: 'deploy-satellite'
  ROBOTTELO_server__deploy_arguments__deploy_rhel_version: '8'
  ROBOTTELO_server__deploy_arguments__deploy_sat_version: '6.14.2'
  ROBOTTELO_server__deploy_arguments__deploy_snap_version: '3.0'

@SatelliteQE SatelliteQE deleted a comment from Satellite-QE Feb 15, 2024
@Satellite-QE
Copy link
Collaborator

PRT Result

Build Number: 5747
Build Status: UNSTABLE
PRT Comment: pytest tests/foreman/ui/test_repository.py -k test_positive_recommended_repos
Test Result : ========== 1 failed, 33 deselected, 12 warnings in 858.26s (0:14:18) ===========

@vsedmik
Copy link
Contributor

vsedmik commented Feb 15, 2024

PRT failed to enable recommended repos in 6.14. Do we need to CP something in Airgun?

11:56:02          with session:
11:56:02              session.organization.select(module_sca_manifest_org.name)
11:56:02  >           rrepos_on = session.redhatrepository.read(recommended_repo='on')
...
11:56:02  >           raise NavigationTriesExceeded(self._name)
11:56:02  E           navmazing._errors.NavigationTriesExceeded: Navigation failed to reach [All] in the specified tries
...
11:56:02  >           raise NoSuchElementException(f"Could not find an element {repr(locator)}") from None
11:56:02  E           selenium.common.exceptions.NoSuchElementException: Message: Could not find an element Locator(by='xpath', locator='.//nav[@class="pf-c-nav" and @label="Global" or @aria-label="Global"]'); For documentation on this error, please visit: https://www.selenium.dev/documentation/webdriver/troubleshooting/errors#no-such-element-exception

@ColeHiggins2 ColeHiggins2 removed the 6.12.z Introduced in or relating directly to Satellite 6.12 label Feb 15, 2024
@vsedmik
Copy link
Contributor

vsedmik commented Feb 15, 2024

trigger: test-robottelo
pytest: tests/foreman/ui/test_repository.py -k test_positive_recommended_repos

@ColeHiggins2
Copy link
Member Author

All comments are addressed, Code is reviewed. Moving to draft until 6.15 airgun fix is merged

@ColeHiggins2 ColeHiggins2 marked this pull request as draft February 15, 2024 15:45
@Satellite-QE
Copy link
Collaborator

PRT Result

Build Number: 5757
Build Status: UNSTABLE
PRT Comment: pytest tests/foreman/ui/test_repository.py -k test_positive_recommended_repos
Test Result : ========== 1 failed, 33 deselected, 12 warnings in 884.45s (0:14:44) ===========

@vsedmik
Copy link
Contributor

vsedmik commented Feb 15, 2024

trigger: test-robottelo
pytest: tests/foreman/ui/test_repository.py -k test_positive_recommended_repos
env:
  ROBOTTELO_server__deploy_workflow: 'deploy-satellite'
  ROBOTTELO_server__deploy_arguments__deploy_rhel_version: '8'
  ROBOTTELO_server__deploy_arguments__deploy_sat_version: '6.15.0'
  ROBOTTELO_server__deploy_arguments__deploy_snap_version: '9.0'

@Satellite-QE
Copy link
Collaborator

PRT Result

Build Number: 5758
Build Status: UNSTABLE
PRT Comment: pytest tests/foreman/ui/test_repository.py -k test_positive_recommended_repos
Test Result : ========== 1 failed, 33 deselected, 12 warnings in 810.44s (0:13:30) ===========

Copy link

github-actions bot commented Apr 1, 2024

This pull request has not been updated in the past 45 days.

@github-actions github-actions bot added the Stale Stale issue or Pull Request label Apr 1, 2024
@lhellebr
Copy link
Contributor

lhellebr commented Apr 8, 2024

@ColeHiggins2 should we close this?

@github-actions github-actions bot removed the Stale Stale issue or Pull Request label Apr 9, 2024
Copy link

This pull request has not been updated in the past 45 days.

@github-actions github-actions bot added the Stale Stale issue or Pull Request label May 25, 2024
Copy link

github-actions bot commented Jun 1, 2024

This pull request is now being closed after stale warnings.

@github-actions github-actions bot closed this Jun 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
6.13.z Introduced in or relating directly to Satellite 6.13 6.14.z Introduced in or relating directly to Satellite 6.14 6.15.z Introduced in or relating directly to Satellite 6.15 CherryPick PR needs CherryPick to previous branches Easy Fix :) Easiest Fix to review and quick merge request. PRT-Failed Indicates that latest PRT run is failed for the PR Stale Stale issue or Pull Request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants