This repository was archived by the owner on Apr 7, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 163
[1LP][RFR] Automate genealogy tests #10039
Merged
Merged
Changes from 3 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
4cc8101
[WIP] Minor fixes to Genealogy class compare method
spusateri eff3342
Added test cleanup and improved test assertion
spusateri 7859fcc
increased amount of time before timeout when waiting for a VM to be c…
spusateri b081778
Changed test title to better fit the increased test scope
spusateri 42df6fa
Removed manual genealogy test for old BZ
spusateri 5d5ea48
Minor fixes in line with reviewers comments
spusateri 05ec5cc
removed redundant calls
spusateri File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,13 +1,17 @@ | ||
| import fauxfactory | ||
| import pytest | ||
| from wait_for import wait_for | ||
|
|
||
| from cfme import test_requirements | ||
| from cfme.cloud.provider import CloudProvider | ||
| from cfme.common.provider import BaseProvider | ||
| from cfme.containers.provider.openshift import OpenshiftProvider | ||
| from cfme.infrastructure.provider.rhevm import RHEVMProvider | ||
| from cfme.infrastructure.provider.scvmm import SCVMMProvider | ||
| from cfme.infrastructure.provider.virtualcenter import VMwareProvider | ||
| from cfme.markers.env_markers.provider import providers | ||
| from cfme.utils.appliance.implementations.ui import navigate_to | ||
| from cfme.utils.generators import random_vm_name | ||
| from cfme.utils.log import logger | ||
| from cfme.utils.providers import ProviderFilter | ||
|
|
||
|
|
@@ -22,6 +26,29 @@ | |
| scope='module'), | ||
| test_requirements.genealogy | ||
| ] | ||
|
|
||
|
|
||
| @pytest.fixture | ||
| def create_vm_with_clone(request, create_vm, provider, appliance): | ||
| """Fixture to provision a VM and clone it""" | ||
| first_name = fauxfactory.gen_alphanumeric() | ||
| last_name = fauxfactory.gen_alphanumeric() | ||
| email = "{first_name}.{last_name}@test.com" | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think you want to use |
||
| provision_type = 'VMware' | ||
|
|
||
| vm_name = random_vm_name(context=None, max_length=15) | ||
|
|
||
| create_vm.clone_vm(email, first_name, last_name, vm_name, provision_type) | ||
| vm2 = appliance.collections.infra_vms.instantiate(vm_name, provider) | ||
| wait_for(lambda: vm2.exists, timeout=120) | ||
|
|
||
| @request.addfinalizer | ||
| def _cleanup(): | ||
| vm2.cleanup_on_provider() | ||
| provider.refresh_provider_relationships() | ||
|
|
||
| return create_vm, vm2 | ||
|
|
||
| # uncollected above in pytest_generate_tests | ||
| @pytest.mark.parametrize("from_edit", [True, False], ids=["via_edit", "via_summary"]) | ||
| @pytest.mark.uncollectif(lambda provider, from_edit: | ||
|
|
@@ -72,9 +99,9 @@ def test_vm_genealogy_detected( | |
| f"{small_template.name} is not in {create_vm.name}'s ancestors" | ||
|
|
||
|
|
||
| @pytest.mark.manual | ||
| @pytest.mark.provider([VMwareProvider]) | ||
| @pytest.mark.tier(1) | ||
| def test_compare_button_enabled(): | ||
| def test_compare_button_enabled(create_vm_with_clone, soft_assert): | ||
| """ | ||
| Test that compare button is enabled | ||
|
|
||
|
|
@@ -97,7 +124,7 @@ def test_compare_button_enabled(): | |
| Bugzilla: | ||
| 1694712 | ||
| """ | ||
| pass | ||
| assert create_vm_with_clone[0].genealogy.compare(*create_vm_with_clone).is_displayed | ||
john-dupuy marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
|
|
||
| @pytest.mark.manual | ||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.