-
Notifications
You must be signed in to change notification settings - Fork 165
[WIP] Tests for grouping cluster candu graphs by tags #8677
base: master
Are you sure you want to change the base?
[WIP] Tests for grouping cluster candu graphs by tags #8677
Conversation
976a23c
to
e625631
Compare
e625631
to
4b5d59e
Compare
4b5d59e
to
96f7726
Compare
e89f0e5
to
279db12
Compare
53e5402
to
9569ecc
Compare
9569ecc
to
2ba1dae
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.
@nachandr check PRT failing also please glance on some comments.
Thanks for this PR 👍
vm_host = vm.host.name | ||
return temp_appliance_extended_db.collections.hosts.instantiate(name=vm_host) | ||
elif entity == 'cluster': | ||
provider = temp_appliance_extended_db.rest_api.collections.providers.get(id=vm.ems_id) |
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:
we have property for getting custer
for specific vm
def cluster(self): |
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.
@nachandr when we were looking at this the other day, we were using the entity object that was returned by the rest api. What @digitronik is suggesting here is to actually use the vm and cluster collections (this will use the GUI).
`In[17]: vm = appliance.collections.infra_vms.instantiate(name='cu-24x7', provider=vmwaretest)
In[18]: vm
Out[18]: InfraVm(name='cu-24x7', provider=VMwareProvider(endpoints={'default': <cfme.infrastructure.provider.virtualcenter.VirtualCenterEndpoint object at 0x7fdff3065650>}, name='vSphere 6.5 (nested)', key='vsphere65-nested', zone='default', start_ip='10.8.196.40', end_ip='10.8.196.40', provider_data=None), template_name=None)
In[19]: vm.cluster
Out[19]: Cluster(name=u'Cluster', provider=VMwareProvider(endpoints={'default': <cfme.infrastructure.provider.virtualcenter.VirtualCenterEndpoint object at 0x7fdff3065650>}, name='vSphere 6.5 (nested)', key='vsphere65-nested', zone='default', start_ip='10.8.196.40', end_ip='10.8.196.40', provider_data=None))
Nikhil and I did chat offline and this is slower with our current implementation. I think both ways work here.
if entity == 'host': | ||
view = navigate_to(entity_object, 'candu') | ||
elif entity == 'cluster': | ||
view = navigate_to(entity_object, 'Utilization') |
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.
aaaaaahhh this was my bad :). I think we need to use same name. TODO: need PR for this.
data = {'interval': interval, 'group_by': gp_by} | ||
view.options.fill(data) | ||
|
||
entity_graph = entity + '_' + graph_type |
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 would use .format
for string formatting
# We have to use vm or host average graph for zoom in operation. | ||
if entity == 'cluster': | ||
graph_zoom = ["cluster_host", "cluster_vm"] | ||
entity_graph = entity + '_' + graph_type |
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.
same as above ^^
if entity == 'cluster': | ||
graph_zoom = ["cluster_host", "cluster_vm"] | ||
entity_graph = entity + '_' + graph_type | ||
avg_graph = entity_graph if entity_graph in graph_zoom \ |
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:
please try to format this; try to avoid \
7294a3b
to
2a01cb2
Compare
I detected some fixture changes in commit 2a01cb2 The local fixture
Please, consider creating a PRT run against these tests make sure your fixture changes do not break existing usage 😃 |
Would you mind rebasing this Pull Request against latest master, please? |
No description provided.