Skip to content

Conversation

@Satellite-QE
Copy link
Collaborator

Cherrypick of PR: #20370

Updated the code in some places so that it now loads the new UI page instead of the old UI for Rocket-based components.
Dependent PR: SatelliteQE/airgun#2231

@Satellite-QE Satellite-QE added 6.18.z Introduced in or relating directly to Satellite 6.18 Auto_Cherry_Picked Automatically cherrypicked PR using GHA No-CherryPick PR doesnt need CherryPick to previous branches labels Dec 17, 2025
@Satellite-QE
Copy link
Collaborator Author

trigger: test-robottelo
pytest: tests/foreman/ui/{test_computeresource_azurerm.py::{test_positive_end_to_end_azurerm_ft_host_provision,test_positive_azurerm_host_provision_ud},test_computeresource_gce.py::{test_positive_gce_provision_end_to_end,test_positive_gce_cloudinit_provision_end_to_end},test_discoveredhost.py::{test_positive_update_name,test_positive_auto_provision_host_with_rule},test_computeresource_libvirt.py::test_positive_provision_end_to_end}
provisioning: true
airgun: 2231

@Satellite-QE Satellite-QE added the AutoMerge_Cherry_Picked The cherrypicked PRs of master PR would be automerged if all checks passing label Dec 17, 2025
Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey there - I've reviewed your changes - here's some feedback:

  • In test_computeresource_gce the second finalize block still uses session.host.search(hostname) while other calls were migrated to session.host_new, which is inconsistent with the rest of the UI migration and may be pointing to the old page inadvertently.
  • Several tests now access deeply nested structures like host_page['overview']['details']['details'][f'{settings.server.NETWORK_TYPE}_address']; consider adding a small helper to retrieve common fields (e.g., host group, IP address, status) from the new UI payload to avoid repetition and reduce brittleness to structural changes.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- In `test_computeresource_gce` the second finalize block still uses `session.host.search(hostname)` while other calls were migrated to `session.host_new`, which is inconsistent with the rest of the UI migration and may be pointing to the old page inadvertently.
- Several tests now access deeply nested structures like `host_page['overview']['details']['details'][f'{settings.server.NETWORK_TYPE}_address']`; consider adding a small helper to retrieve common fields (e.g., host group, IP address, status) from the new UI payload to avoid repetition and reduce brittleness to structural changes.

## Individual Comments

### Comment 1
<location> `tests/foreman/ui/test_discoveredhost.py:289` </location>
<code_context>
 @pytest.mark.on_premises_provisioning
 @pytest.mark.parametrize('module_provisioning_sat', ['discovery'], indirect=True)
[email protected]('pxe_loader', ['bios', 'uefi'], indirect=True)
[email protected]('pxe_loader', ['bios'], indirect=True)
 @pytest.mark.rhel_ver_match('9')
 def test_positive_auto_provision_host_with_rule(
</code_context>

<issue_to_address>
**issue (testing):** Dropping `uefi` from the parametrized `pxe_loader` reduces test coverage of the provisioning path

This change means the test no longer validates discovery + auto‑provisioning for UEFI. If this is due to flakiness or a UI limitation, consider either keeping `uefi` and updating the assertions, or clearly documenting why `uefi` is excluded and adding a separate UEFI‑specific test to preserve coverage of that path.
</issue_to_address>

### Comment 2
<location> `tests/foreman/ui/test_computeresource_gce.py:210` </location>
<code_context>
-            assert host_info['properties']['properties_table']['Build'] == 'Installed clear'
+            host_info = session.host_new.get_host_statuses(hostname)
+            assert session.host_new.search(hostname)[0]['Name'] == hostname
+            assert host_info['Build']['Status'] == 'Installed'
             # 1.2 GCE Backend Assertions
             gceapi_vm = googleclient.get_vm(gceapi_vmname)
</code_context>

<issue_to_address>
**suggestion (testing):** New UI assertions no longer verify the "clear"/build flag that the old tests were checking

Previously we asserted `host_info['properties']['properties_table']['Build'] == 'Installed clear'`, which validated both install status and that the build flag was cleared. The new check `host_info['Build']['Status'] == 'Installed'` only covers install status. If the new API exposes an equivalent “clear”/build-complete indicator (e.g., another field), please add an assertion for it so we preserve the original test intent.

Suggested implementation:

```python
            host_info = session.host_new.get_host_statuses(hostname)
            assert session.host_new.search(hostname)[0]['Name'] == hostname
            assert host_info['Build']['Status'] == 'Installed'
            # Preserve original intent: verify build flag is cleared/completed in addition to install status
            assert host_info['Build']['Clear'] is True
            # 1.2 GCE Backend Assertions

```

You’ll need to adjust `host_info['Build']['Clear']` to match the actual field the new API exposes for the “clear”/build-complete indicator. For example, depending on the schema this might instead be something like:
- `host_info['Build']['Flag'] == 'clear'`
- `host_info['Build']['Completed'] is True`
- `host_info['Build']['StatusDetail'] == 'Installed clear'`

Please inspect the structure returned by `session.host_new.get_host_statuses(hostname)` (e.g., via debugging/logging in another test or REPL) and update the assertion to match the correct key and expected value.
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@Satellite-QE
Copy link
Collaborator Author

PRT Result

Build Number: 13898
Build Status: UNSTABLE
PRT Comment: pytest tests/foreman/ui/{test_computeresource_azurerm.py::{test_positive_end_to_end_azurerm_ft_host_provision,test_positive_azurerm_host_provision_ud},test_computeresource_gce.py::{test_positive_gce_provision_end_to_end,test_positive_gce_cloudinit_provision_end_to_end},test_discoveredhost.py::{test_positive_update_name,test_positive_auto_provision_host_with_rule},test_computeresource_libvirt.py::test_positive_provision_end_to_end} --external-logging --include-onprem-provisioning
Test Result : ============ 9 failed, 2 passed, 298 warnings in 7936.11s (2:12:16) ============

@Satellite-QE Satellite-QE added the PRT-Failed Indicates that latest PRT run is failed for the PR label Dec 17, 2025
@Gauravtalreja1
Copy link
Member

trigger: test-robottelo
pytest: tests/foreman/ui/{test_computeresource_azurerm.py::{test_positive_end_to_end_azurerm_ft_host_provision,test_positive_azurerm_host_provision_ud},test_computeresource_gce.py::{test_positive_gce_provision_end_to_end,test_positive_gce_cloudinit_provision_end_to_end},test_discoveredhost.py::{test_positive_update_name,test_positive_auto_provision_host_with_rule},test_computeresource_libvirt.py::test_positive_provision_end_to_end}
provisioning: true

@Satellite-QE
Copy link
Collaborator Author

PRT Result

Build Number: 13934
Build Status: UNSTABLE
PRT Comment: pytest tests/foreman/ui/{test_computeresource_azurerm.py::{test_positive_end_to_end_azurerm_ft_host_provision,test_positive_azurerm_host_provision_ud},test_computeresource_gce.py::{test_positive_gce_provision_end_to_end,test_positive_gce_cloudinit_provision_end_to_end},test_discoveredhost.py::{test_positive_update_name,test_positive_auto_provision_host_with_rule},test_computeresource_libvirt.py::test_positive_provision_end_to_end} --external-logging --include-onprem-provisioning
Test Result : =========== 7 failed, 4 passed, 373 warnings in 12668.61s (3:31:08) ============

@devendra104
Copy link
Member

trigger: test-robottelo
pytest: tests/foreman/ui/{test_computeresource_azurerm.py::{test_positive_end_to_end_azurerm_ft_host_provision,test_positive_azurerm_host_provision_ud},test_computeresource_gce.py::{test_positive_gce_provision_end_to_end,test_positive_gce_cloudinit_provision_end_to_end},test_discoveredhost.py::{test_positive_update_name,test_positive_auto_provision_host_with_rule},test_computeresource_libvirt.py::test_positive_provision_end_to_end}
provisioning: true

@Satellite-QE
Copy link
Collaborator Author

PRT Result

Build Number: 13935
Build Status: UNSTABLE
PRT Comment: pytest tests/foreman/ui/{test_computeresource_azurerm.py::{test_positive_end_to_end_azurerm_ft_host_provision,test_positive_azurerm_host_provision_ud},test_computeresource_gce.py::{test_positive_gce_provision_end_to_end,test_positive_gce_cloudinit_provision_end_to_end},test_discoveredhost.py::{test_positive_update_name,test_positive_auto_provision_host_with_rule},test_computeresource_libvirt.py::test_positive_provision_end_to_end} --external-logging --include-onprem-provisioning
Test Result : =========== 7 failed, 4 passed, 371 warnings in 11424.48s (3:10:24) ============

@amolpati30 amolpati30 force-pushed the cherry-pick-6.18.z-34b039829be117b2fdb49207538287f830f84c02 branch 2 times, most recently from dcc470d to 64d0ac8 Compare December 24, 2025 18:58
update the host page old to new UI

(cherry picked from commit 34b0398)
@amolpati30 amolpati30 force-pushed the cherry-pick-6.18.z-34b039829be117b2fdb49207538287f830f84c02 branch from 64d0ac8 to c731424 Compare December 24, 2025 19:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

6.18.z Introduced in or relating directly to Satellite 6.18 Auto_Cherry_Picked Automatically cherrypicked PR using GHA AutoMerge_Cherry_Picked The cherrypicked PRs of master PR would be automerged if all checks passing No-CherryPick PR doesnt need CherryPick to previous branches PRT-Failed Indicates that latest PRT run is failed for the PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants