Skip to content

[SAT-33810] New Hosts UI fix - VM setup #18753

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

damoore044
Copy link
Contributor

@damoore044 damoore044 commented Jun 17, 2025

Problem Statement

3 new host UI cases failing to setup their virtual machine, outdated args passed, custom repos not enabled, etc.

To parametrize implicitly, without putting a really ugly for loop in the test's parametrization,
I was able to get module_repos_collection_with_setup to work with distro in request, or without.
By falling back on globally defined fixture's RHEL host, declared rhel_version, if present.

^ Effect: We can still parametrize module_repos_collection_with_setup with distro explicitly as we currently do.
But if distro is None or missing, it will look for and fallback on fixture hosts with rhel_version.

Can now parametrize the module_repos_collection fixture with ubiquitous rhel markers: rhel_ver_match or rhel_ver_list.
^ but only if distro is missing, or None.

Solution

Resolved setup issues and local pass.
Implicitly parametrize module_repos_collection_with_setup for these cases by @pytest.mark.rhel_ver_match('N-1')
RHEL version / distro by N-1 (2 params for each of the 3 cases). N in stream is RHEL10.
^ instead of hardcoding to rhel8, which needs to be updated regularly or becomes outdated.

Needs: Airgun#1888

PRT Case

trigger: test-robottelo
pytest: tests/foreman/ui/test_host.py -k 'test_positive_crud_module_streams or test_positive_apply_erratum or test_positive_update_delete_package'

@damoore044 damoore044 self-assigned this Jun 17, 2025
@damoore044 damoore044 requested a review from a team as a code owner June 17, 2025 15:17
@damoore044 damoore044 added Easy Fix :) Easiest Fix to review and quick merge request. CherryPick PR needs CherryPick to previous branches Stream Introduced in or relating directly to Satellite Stream/Master 6.16.z Introduced in or relating directly to Satellite 6.16 6.17.z labels Jun 17, 2025
@damoore044
Copy link
Contributor Author

trigger: test-robottelo
pytest: tests/foreman/ui/test_host.py -k 'test_positive_crud_module_streams or test_positive_apply_erratum or test_positive_update_delete_package'

@Satellite-QE
Copy link
Collaborator

PRT Result

Build Number: 11818
Build Status: UNSTABLE
PRT Comment: pytest tests/foreman/ui/test_host.py -k test_positive_crud_module_streams or test_positive_apply_erratum or test_positive_update_delete_package --external-logging
Test Result : ========= 6 failed, 82 deselected, 748 warnings in 12898.16s (3:34:58) =========

@Satellite-QE Satellite-QE added the PRT-Failed Indicates that latest PRT run is failed for the PR label Jun 17, 2025
@damoore044 damoore044 requested a review from a team as a code owner June 18, 2025 15:40
@damoore044 damoore044 requested a review from a team June 18, 2025 15:40
@damoore044
Copy link
Contributor Author

trigger: test-robottelo
pytest: tests/foreman/ui/test_host.py::test_positive_crud_module_streams[rhel10-ipv4-module_stream_1]

@Satellite-QE
Copy link
Collaborator

PRT Result

Build Number: 11843
Build Status: UNSTABLE
PRT Comment: pytest tests/foreman/ui/test_host.py::test_positive_crud_module_streams[rhel10-ipv4-module_stream_1] --external-logging
Test Result : ================= 1 failed, 13 warnings in 1235.88s (0:20:35) ==================

@damoore044 damoore044 removed the Easy Fix :) Easiest Fix to review and quick merge request. label Jun 18, 2025
@damoore044 damoore044 requested a review from JacobCallahan June 20, 2025 16:34
@damoore044
Copy link
Contributor Author

trigger: test-robottelo
pytest: tests/foreman/ui/test_host.py::test_positive_crud_module_streams[rhel10-ipv4-module_stream_1]

@damoore044
Copy link
Contributor Author

trigger: test-robottelo
pytest: tests/foreman/ui/test_host.py::test_positive_crud_module_streams[rhel10-ipv6-module_stream_1]
network_type: ipv6

@damoore044 damoore044 force-pushed the vm_setup_new_host branch 2 times, most recently from fd6c3c6 to a8f5460 Compare June 20, 2025 16:49
@damoore044
Copy link
Contributor Author

trigger: test-robottelo
pytest: tests/foreman/ui/test_host.py::test_positive_crud_module_streams[rhel10-ipv4-module_stream_1]
airgun: 1888

@Satellite-QE
Copy link
Collaborator

PRT Result

Build Number: 11873
Build Status: UNSTABLE
PRT Comment: pytest tests/foreman/ui/test_host.py::test_positive_crud_module_streams[rhel10-ipv4-module_stream_1] --external-logging
Test Result : ================= 1 failed, 14 warnings in 1220.23s (0:20:20) ==================

@Satellite-QE
Copy link
Collaborator

PRT Result

Build Number: 11875
Build Status: UNSTABLE
PRT Comment: pytest tests/foreman/ui/test_host.py::test_positive_crud_module_streams[rhel10-ipv4-module_stream_1] --external-logging
Test Result : ================= 1 failed, 14 warnings in 1246.03s (0:20:46) ==================

@Satellite-QE
Copy link
Collaborator

PRT Result

Build Number: 11877
Build Status: UNSTABLE
PRT Comment: pytest tests/foreman/ui/test_host.py::test_positive_crud_module_streams[rhel10-ipv4-module_stream_1] --external-logging
Test Result : ================= 1 failed, 14 warnings in 2106.19s (0:35:06) ==================

@damoore044 damoore044 force-pushed the vm_setup_new_host branch from a8f5460 to 62f7d09 Compare July 1, 2025 19:21
@damoore044 damoore044 requested a review from a team as a code owner July 1, 2025 19:21
@JacobCallahan JacobCallahan requested a review from Copilot July 1, 2025 19:54
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR modernizes RHEL version handling in UI tests, updates VM setup invocation, enhances custom repo enabling logic, and streamlines repo fixtures.

  • Switches hardcoded rhel8 markers to dynamic N-1 and refactors setup_virtual_machine calls to use enable_custom_repos
  • Adds SCA fallback via subscription-manager in contenthost_setup and enriches error output
  • Implements a fallback for missing distro in module_repos_collection_with_setup based on pytest markers

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.

File Description
tests/foreman/ui/test_host.py Updated parametrization to use N-1, removed explicit distro, changed VM setup args
tests/foreman/ui/test_errata.py Simplified cleanup if client and client.subscribed
robottelo/hosts.py Added subscription-manager enable attempt with fallback and error detail
pytest_fixtures/component/repository.py Added logic to derive distro from top‐level markers

@damoore044 damoore044 force-pushed the vm_setup_new_host branch from 62f7d09 to 5eabcd6 Compare July 3, 2025 13:51
@damoore044 damoore044 force-pushed the vm_setup_new_host branch from 5eabcd6 to ff9994f Compare July 7, 2025 16:27
@vsedmik
Copy link
Contributor

vsedmik commented Jul 9, 2025

trigger: test-robottelo
pytest: tests/foreman/ui/test_host.py::test_positive_crud_module_streams[rhel10-ipv4-module_stream_1]
airgun: 1888

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.

Codewisely looks good to me (just one nit), but I wasn't able to find the PRT result to dig into the previous failure. Rerunning now. 🤞

if repos['distro'] is None:
repos['distro'] = fixtures_distro
if repos['distro'] and 'rhel' not in str(repos['distro']):
repos['distro'] = 'rhel' + str(repos['distro'])
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
repos['distro'] = 'rhel' + str(repos['distro'])
repos['distro'] = f'rhel{repos['distro']}'

@Satellite-QE
Copy link
Collaborator

PRT Result

Build Number: 12027
Build Status: UNSTABLE
PRT Comment: pytest tests/foreman/ui/test_host.py::test_positive_crud_module_streams[rhel10-ipv4-module_stream_1] --external-logging
Test Result : ================= 1 failed, 14 warnings in 1395.07s (0:23:15) ==================

@vsedmik
Copy link
Contributor

vsedmik commented Jul 9, 2025

PRT failed with selenium.common.exceptions.NoSuchElementException: Message: Could not find an element Locator(by='xpath', locator='./button');

Is it something to be addressed in SatelliteQE/airgun#1888 @damoore044 ?

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 6.17.z CherryPick PR needs CherryPick to previous branches PRT-Failed Indicates that latest PRT run is failed 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.

3 participants