Skip to content
This repository has been archived by the owner on Apr 7, 2022. It is now read-only.

[1LP][RFR] Replace usage of entity.check() with entity.ensure_checked. Part 2. #9816

Merged
merged 3 commits into from
Jan 22, 2020

Conversation

prichard77
Copy link
Contributor

@prichard77 prichard77 commented Jan 7, 2020

Purpose or Intent

  • Updating tests and framework to use entity ensure_checked() instead of entity.check(). ensure_checked() is an enhancement to check() functionality that accounts for the checked state of an entity when selecting it.

PRT Run

{{ pytest: --use-provider rhv42 --use-provider rhos13 --long-running cfme/tests/physical_infrastructure/ui/test_physical_server_list_buttons.py::test_manage_button cfme/tests/infrastructure/test_pxe.py::test_pxe_server_crud cfme/tests/infrastructure/test_host.py::test_infrastructure_hosts_navigation_after_download_from_compare cfme/tests/infrastructure/test_vm_power_control.py::test_no_template_power_control cfme/tests/infrastructure/test_vm_power_control.py::test_retire_vm_with_vm_user_role }}

@@ -293,7 +293,7 @@ def select_entity_rows(self, physical_servers):
view = navigate_to(self, 'All')

for physical_server in physical_servers:
view.entities.get_entity(name=physical_server.name, surf_pages=True).check()
view.entities.get_entity(name=physical_server.name, surf_pages=True).ensure_checked()
Copy link
Contributor Author

Choose a reason for hiding this comment

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

added to PRT to cover this. cfme/tests/physical_infrastructure/ui/test_physical_server_list_buttons.py::test_manage_button

@@ -1128,5 +1128,5 @@ def remove_all_pxe_servers():
view = navigate_to(PXEServer, 'All')
if view.entities.is_displayed:
for entity in view.entities.rows():
entity[0].check()
entity[0].ensure_checked()
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added tp PRT to cover this. cfme/tests/physical_infrastructure/ui/test_physical_server_list_buttons.py::test_manage_button
I was unable to get the test run to hit the updated code when running locally, but am hoping PRT might catch it. There were no pxe servers for me to delete when running locally.

@@ -476,7 +476,7 @@ def check_hosts(self, hosts):

for host in hosts:
try:
view.entities.get_entity(name=host.name, surf_pages=True).check()
view.entities.get_entity(name=host.name, surf_pages=True).ensure_checked()
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added tp PRT to cover this. cfme/tests/infrastructure/test_host.py::test_infrastructure_hosts_navigation_after_download_from_compare

@@ -413,7 +413,7 @@ def test_no_template_power_control(provider, soft_assert):
# Check the power button with checking the quadicon
view = navigate_to(selected_template, 'AllForProvider', use_resetter=False)
entity = view.entities.get_entity(name=selected_template.name, surf_pages=True)
entity.check()
entity.ensure_checked()
Copy link
Contributor Author

Choose a reason for hiding this comment

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

added to PRT to cover this. cfme/tests/infrastructure/test_vm_power_control.py::test_no_template_power_control
cfme/tests/infrastructure/test_vm_power_control.py::test_retire_vm_with_vm_user_role

@prichard77
Copy link
Contributor Author

When I run this locally, I get 16 items collected? I am not sure why PRT keeps going invalid.

@prichard77
Copy link
Contributor Author

Rerunning PRT again. 5.11 passed last time, but 5.10 is still hanging because of an issue. Marking RFR to get the process started.

@prichard77 prichard77 changed the title [WIPTEST] Replace usage of entity.check() with entity.ensure_checked. Part 2. [RFR] Replace usage of entity.check() with entity.ensure_checked. Part 2. Jan 21, 2020
Copy link
Contributor

@john-dupuy john-dupuy left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for tracking down these usages 👍

@john-dupuy john-dupuy changed the title [RFR] Replace usage of entity.check() with entity.ensure_checked. Part 2. [1LP][RFR] Replace usage of entity.check() with entity.ensure_checked. Part 2. Jan 21, 2020
@mshriver mshriver merged commit 39bc37c into ManageIQ:master Jan 22, 2020
spusateri pushed a commit to spusateri/integration_tests that referenced this pull request Jan 27, 2020
…. Part 2. (ManageIQ#9816)

* Replace check() with ensure_checked() in PhysicalRackCollection

* Replace check() with ensure_checked() in physical files

* Replace check() with ensure_checked() in another group of files
@prichard77 prichard77 deleted the replaceCheck2 branch March 10, 2020 18:42
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants