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

Extend search in *_default_os fixtures for EL9 as default OS #14851

Merged
merged 2 commits into from
Apr 25, 2024

Conversation

Gauravtalreja1
Copy link
Collaborator

@Gauravtalreja1 Gauravtalreja1 commented Apr 22, 2024

Problem Statement

When EL9 is default OS for Foreman, *_default_os fixtures returns below error

pytest_fixtures/component/os.py:24: in default_os
    os = entities.OperatingSystem().search(query={'search': search_string})[0].read()
E   IndexError: list index out of range

Solution

Add EL9 in search_string for *_default_os fixtures
Move default os search query to constants and delete unused session_default_os fixture (from review)

Related Issues

@Gauravtalreja1 Gauravtalreja1 added Easy Fix :) Easiest Fix to review and quick merge request. No-CherryPick PR doesnt need CherryPick to previous branches Stream Introduced in or relating directly to Satellite Stream/Master labels Apr 22, 2024
@Gauravtalreja1 Gauravtalreja1 self-assigned this Apr 22, 2024
@Gauravtalreja1 Gauravtalreja1 requested a review from a team as a code owner April 22, 2024 09:30
@Gauravtalreja1
Copy link
Collaborator Author

trigger: test-robottelo
pytest: tests/foreman/ui/test_registration.py::test_positive_global_registration_end_to_end[rhel9]

@Satellite-QE
Copy link
Collaborator

PRT Result

Build Number: 6638
Build Status: SUCCESS
PRT Comment: pytest tests/foreman/ui/test_registration.py::test_positive_global_registration_end_to_end[rhel9] --external-logging
Test Result : ================= 1 passed, 15 warnings in 1104.39s (0:18:24) ==================

@Satellite-QE Satellite-QE added the PRT-Passed Indicates that latest PRT run is passed for the PR label Apr 22, 2024
@@ -17,7 +17,7 @@ def default_os(
"""
os = getattr(request, 'param', None)
if os is None:
search_string = 'name="RedHat" AND (major="6" OR major="7" OR major="8")'
search_string = 'name="RedHat" AND (major="6" OR major="7" OR major="8" OR major="9")'
Copy link
Contributor

Choose a reason for hiding this comment

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

@Gauravtalreja1 maybe we should fix following occurrences too.

OR we should add this query as a constant so we won't have to go through this in future, wdyt?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I wonder how tests from test_contentview_old is working even when Foreman is on EL8, and second one from api_factory helper is unused so its expected we missed it for EL8 earlier.

@jameerpathan111 Good point, about moving this search query as robottelo contant, so we can update this at single place when OS version changes. I've made the changes, request to re-review, Thank you!

@Gauravtalreja1 Gauravtalreja1 requested a review from a team as a code owner April 22, 2024 10:51
@Satellite-QE Satellite-QE removed the PRT-Passed Indicates that latest PRT run is passed for the PR label Apr 22, 2024
@Gauravtalreja1 Gauravtalreja1 removed the Easy Fix :) Easiest Fix to review and quick merge request. label Apr 22, 2024
@Gauravtalreja1
Copy link
Collaborator Author

trigger: test-robottelo
pytest: tests/foreman/ui/test_registration.py::test_positive_global_registration_end_to_end[rhel9]

@@ -17,7 +19,7 @@ def default_os(
"""
os = getattr(request, 'param', None)
if os is None:
search_string = 'name="RedHat" AND (major="6" OR major="7" OR major="8")'
search_string = constants.DEFAULT_OS_SEARCH_QUERY
Copy link
Member

Choose a reason for hiding this comment

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

FYI, there is a discussion/PR in progress on how we retrieve the default OS.

We are to remove the need of search string especially for searching default os.

Copy link
Contributor

Choose a reason for hiding this comment

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

@jyejare I don't see much progress on the discussion there. Do we want to hold off on this PR/fix? Is someone already assigned to work on it?

Copy link
Member

Choose a reason for hiding this comment

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

@jameerpathan111 @Gauravtalreja1 can either choose to fix discussion/PR comment in this PR or merge this as is if its urgent.

Which we would you like to go ?

Copy link
Collaborator Author

@Gauravtalreja1 Gauravtalreja1 Apr 25, 2024

Choose a reason for hiding this comment

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

@jyejare I'd prefer getting this merged as it is as its urgent for automation many tests are failing due to this, and we can discuss this in JPL call later to make this dynamically configurable later which can be handled in separate PR

Copy link
Collaborator

Choose a reason for hiding this comment

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

a ping would have been nice

Copy link
Collaborator

Choose a reason for hiding this comment

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

@jyejare I don't see much progress on the discussion there. Do we want to hold off on this PR/fix? Is someone already assigned to work on it?

2 weeks ago there were two approvals and no answer from @lpramuk requested changes

@Satellite-QE
Copy link
Collaborator

PRT Result

Build Number: 6639
Build Status: SUCCESS
PRT Comment: pytest tests/foreman/ui/test_registration.py::test_positive_global_registration_end_to_end[rhel9] --external-logging
Test Result : ================= 1 passed, 15 warnings in 1160.57s (0:19:20) ==================

@Satellite-QE Satellite-QE added the PRT-Passed Indicates that latest PRT run is passed for the PR label Apr 22, 2024
@ogajduse
Copy link
Member

I would like to remind the audience of this PR that there is an open issue pointing to the need to add newly released versions to the list. My personal preference would be to address the issue rather than continue using the same pattern.
#10481

@jameerpathan111
Copy link
Contributor

jameerpathan111 commented Apr 24, 2024

I would like to remind the audience of this PR that there is an open issue pointing to the need to add newly released versions to the list. My personal preference would be to address the issue rather than continue using the same pattern. #10481

@Gauravtalreja1 what do you want to do? do you want to take up this task or go with your current approach?

@jameerpathan111 jameerpathan111 requested a review from jyejare April 24, 2024 15:54
@pondrejk pondrejk merged commit 7be34b0 into SatelliteQE:master Apr 25, 2024
11 of 12 checks passed
@Gauravtalreja1 Gauravtalreja1 deleted the default-os-el9 branch April 26, 2024 07:18
jyejare pushed a commit to jyejare/robottelo that referenced this pull request Oct 19, 2024
…teQE#14851)

* Extend search in *_default_os fixtures for EL9 as default OS

Signed-off-by: Gaurav Talreja <[email protected]>

* Move default os search query to constants and delete unused session_default_os fixture

Signed-off-by: Gaurav Talreja <[email protected]>

---------

Signed-off-by: Gaurav Talreja <[email protected]>
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 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.

7 participants