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

[1LP][RFR] Zone test automation / parametrization #9898

Merged
merged 1 commit into from
Feb 14, 2020
Merged

[1LP][RFR] Zone test automation / parametrization #9898

merged 1 commit into from
Feb 14, 2020

Conversation

tpapaioa
Copy link
Contributor

@tpapaioa tpapaioa commented Feb 3, 2020

This PR makes the following changes to zone- and server-related tests:

1.) Rename test_zone_add_dupe to test_zone_add_duplicate.
2.) Move zone name and description generation out of create_zone() and into the individual tests in cfme/tests/configure/test_zones.py:. This might eventually be moved into a parametrized fixture.
3.) Automate some manual tests and remove them from cfme/tests/distributed/test_appliance_manual.py. The new automated tests are in cfme/tests/configure/test_zones.py:

test_distributed_field_zone_description_special and test_distributed_field_zone_name_special -> test_zone_add_punctuation
test_distributed_field_zone_name_whitespace and test_distributed_field_zone_description_leading_whitespace -> test_zone_add_whitespace

The new test test_zone_add_whitespace is marked with a BZ blocker for:

Bug 1797715 - Whitespace in name/description/etc. not displayed faithfully in UI
https://bugzilla.redhat.com/show_bug.cgi?id=1797715

4.) Add a small fix to the step() method in cfme.base.ui.ZoneSettings. In test_zone_add_punctuation, for example, the presence of any regex special characters in the zone description would break the navigation, so the description is now passed through re.escape() first:

     def step(self, *args, **kwargs):
-        rows = self.prerequisite_view.table.rows((1, re.compile(r'Zone\s?\:\s?{}'.format(
-            self.obj.description))))
+        regex = re.compile(r'Zone\s?\:\s?{}'.format(re.escape(self.obj.description)))
+        rows = self.prerequisite_view.table.rows((1, regex))

5.) Move the manual server role failover tests in cfme/tests/distributed/test_appliance_manual.py:

test_distributed_zone_failover_cu_data_processor
test_distributed_migrate_embedded_ansible_role
test_distributed_zone_failover_reporting
test_distributed_zone_failover_cu_data_collector
test_distributed_zone_failover_web_services
test_distributed_zone_failover_cu_coordinator_singleton
test_distributed_zone_failover_smartstate_analysis
test_distributed_zone_failover_scheduler_singleton
test_distributed_zone_failover_provider_inventory_singleton
test_distributed_zone_failover_provider_operations
test_distributed_zone_failover_notifier_singleton

to the new parametrized test (still manual):

test_server_role_failover[role].

{{ pytest: cfme/tests/configure/test_zones.py -v }}

@tpapaioa tpapaioa changed the title [WIPTEST] Zone test automation / parametrization [RFR] Zone test automation / parametrization Feb 3, 2020
@dajoRH dajoRH removed the WIP-testing label Feb 3, 2020
@john-dupuy john-dupuy added the test-cleanup Test removal, collection changes, re-organization label Feb 6, 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.

Nice PR, LGTM 👍

@john-dupuy john-dupuy changed the title [RFR] Zone test automation / parametrization [1LP][RFR] Zone test automation / parametrization Feb 6, 2020
zc.filters = {'parent': region}
zones = zc.all()
new_zone = None
for zone in zones:
if (zone.name == name and zone.description == description):
if zone.name == name and zone.description == desc:
Copy link
Member

Choose a reason for hiding this comment

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

Optional

Consider implementing an __eq__ method for the zone class, so that they can be directly compared.

https://github.com/ManageIQ/integration_tests/blob/master/cfme/configure/configuration/region_settings.py#L75

@mshriver mshriver added the test-automation To be applied on PR's which are automating existing manual cases label Feb 14, 2020
@mshriver mshriver merged commit fe2c007 into ManageIQ:master Feb 14, 2020
@tpapaioa tpapaioa deleted the automate_zone_tests branch March 6, 2020 22:02
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
lint-ok test-automation To be applied on PR's which are automating existing manual cases test-cleanup Test removal, collection changes, re-organization
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants