-
Notifications
You must be signed in to change notification settings - Fork 165
[1LP][RFR] New Test: Checks moving VMWare vm to custom vm folder #9230
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice test case! LGTM 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good PR. I like it. there're two reservations though.
- please check my comment
- your test hasn't been run in PRT
"""Create Vm folder on VMWare provider""" | ||
folder = provider.mgmt.create_folder(f"{fauxfactory.gen_alpha()}") | ||
yield folder | ||
vm_folder.Destroy() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
are you sure there should be vm_folder instead of folder ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My bad!
It should be folder.
Thanks :)
@pytest.fixture(scope="module") | ||
def vm_folder(provider): | ||
"""Create Vm folder on VMWare provider""" | ||
folder = provider.mgmt.create_folder(f"{fauxfactory.gen_alpha()}") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ganeshhubale I think, we wont need string formatting here.
ae0f234
to
4cb7d11
Compare
4cb7d11
to
0b1e002
Compare
0b1e002
to
bdce549
Compare
101701f
to
a78db9b
Compare
a78db9b
to
0165d27
Compare
0165d27
to
c61b597
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, just couple of changes required.
@pytest.fixture(scope="function") | ||
def vm_folder(provider): | ||
"""Create Vm folder on VMWare provider""" | ||
folder = provider.mgmt.create_folder(fauxfactory.gen_alpha()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be prefixed with something meaningful. Please use some context+fauxfactory.gen_alpha()
As a VMware admin I would like to know who is creating the folders.
"""Create Vm folder on VMWare provider""" | ||
folder = provider.mgmt.create_folder(fauxfactory.gen_alpha()) | ||
yield folder | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
REQUIRED: Remove the folder after test is finished.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
folder_
does not seem to be a good start for name, maybe add something like test_move_vm_folder_{fauxfactory name}
might be longer name but gives more context.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ganeshhubale please review above suggestion, add little more context to name folder_
.. maybe test_folder_
.
|
||
@request.addfinalizer | ||
def _finished(): | ||
fd = vm_folder.Destroy() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it should be part of fixture that created the folder.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please check consider suggestion, else LGTM 💯
@@ -320,3 +321,60 @@ def _finalize(): | |||
assert provision_request.is_succeeded( | |||
method="ui" | |||
), f"Provisioning failed: {provision_request.row.last_message.text}" | |||
|
|||
|
|||
@pytest.fixture(scope="function") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggestion:
@ganeshhubale Can you please move this fixture to above, not in between tests.
3f0fe5c
to
b3ae9b9
Compare
5e27c5b
to
d969923
Compare
d969923
to
6fd3f97
Compare
6fd3f97
to
8b0d4cd
Compare
I detected some fixture changes in commit 8b0d4cd The local fixture
Please, consider creating a PRT run to make sure your fixture changes do not break existing usage 😃 |
except CandidateNotFound: | ||
return False | ||
|
||
wait_for(lambda: _check, fail_func=view.browser.refresh, timeout=600, delay=5, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OPTIONAL: I'd advice wrapping this into try/except block with pytest.fail next time. currently it will appear broken if this wait_for fails.
…ageIQ#9230) * New Test: This test case checks moving VMWare vm to custom folder via automate method * Updated with requested changes
Purpose or Intent
move_into_folder
to move VMWare vm to custom folder via automate methodPRT Run
{{ pytest: cfme/tests/automate/test_common_methods.py::test_move_vm_into_folder --use-provider=complete --use-template-cache -qsvv }}