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

[WIP]Implemented automated test for add_provider_with_instance_without_name #9826

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mmojzis
Copy link
Contributor

@mmojzis mmojzis commented Jan 9, 2020

{{ pytest: -k "test_add_provider_with_instance_without_name" -v }}

@dajoRH dajoRH added the lint-ok label Jan 9, 2020
@mmojzis mmojzis force-pushed the test_add_provider_with_instance_without_name branch from 050b4cc to 00e1991 Compare January 9, 2020 14:20
@mmojzis mmojzis changed the title Implemented automated test for add_provider_with_instance_without_name [WIPTEST]Implemented automated test for add_provider_with_instance_without_name Jan 9, 2020
@mmojzis mmojzis force-pushed the test_add_provider_with_instance_without_name branch from 00e1991 to 1ef9180 Compare January 20, 2020 15:15
@dajoRH
Copy link
Contributor

dajoRH commented Jan 20, 2020

I detected some fixture changes in commit 1ef9180

The local fixture instance_without_name is used in the following files:

  • cfme/tests/cloud/test_providers.py
    • test_add_provider_with_instance_without_name

Please, consider creating a PRT run to make sure your fixture changes do not break existing usage 😃

@mmojzis mmojzis changed the title [WIPTEST]Implemented automated test for add_provider_with_instance_without_name [RFR]Implemented automated test for add_provider_with_instance_without_name Jan 29, 2020
@john-dupuy john-dupuy added the test-automation To be applied on PR's which are automating existing manual cases label Jan 29, 2020
Comment on lines +212 to +216
def instance_without_name(provider):
template_id = provider.mgmt.get_template(
provider.data.templates.get('small_template').name).uuid
instance = provider.mgmt.create_vm(template_id)
wait_for(lambda: instance.state == VmState.RUNNING, delay=15, timeout=900)
Copy link
Contributor

@john-dupuy john-dupuy Jan 29, 2020

Choose a reason for hiding this comment

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

Q: Can you use the create_vm fixture?

@pytest.fixture(scope="function")
def create_vm(setup_provider, request, provider):
if request.param:
template_type = request.param
else:
pytest.error('Any appropriate Template was not passed to the fixture.')
vm_name = _get_vm_name(request)
return _create_vm(request, template_type, provider, vm_name)

Or just the _create_vm method? That way you can specify the template and name.

@john-dupuy john-dupuy changed the title [RFR]Implemented automated test for add_provider_with_instance_without_name [WIPTEST]Implemented automated test for add_provider_with_instance_without_name Jan 29, 2020
@dajoRH dajoRH changed the title [WIPTEST]Implemented automated test for add_provider_with_instance_without_name [WIP]Implemented automated test for add_provider_with_instance_without_name Feb 7, 2020
@dajoRH
Copy link
Contributor

dajoRH commented Feb 7, 2020

Would you mind rebasing this Pull Request against latest master, please? :trollface:
CFME QE Bot

@dajoRH dajoRH added WIP and removed WIP-testing labels Feb 7, 2020
@mmojzis
Copy link
Contributor Author

mmojzis commented Apr 14, 2020

@kedark3 @john-dupuy @mshriver
So I would like to make this PR merged.
The problem is that create_vm by default doesn't handle vm without name.
I tried to use _create_vm(), but it didn't work as wrapanapi had no identificator for vm - by default it's name, but when instance doesn't have name it's identified by uuid, but _create_vm doesn't provide one.
As I am leaving by the end of this month I would like to make this PR merged without using create_vm.
I could try to fix the issue, but it would take me probably a lot of time and I don't see the point to use create_vm as it's premise is AFAIK that every VM created by this method has test assignee as a suffix in its name, which cannot be applied for this specific test.
Thanks for feedback.

@mshriver mshriver self-assigned this Apr 27, 2020
@mshriver mshriver self-requested a review April 27, 2020 13:16
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
lint-ok needs-rebase test-automation To be applied on PR's which are automating existing manual cases WIP
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants