[openstack-dev] [Tempest][Neutron] Network client and API tests refactoring.

Jay Pipes jaypipes at gmail.com
Sat Dec 14 15:01:41 UTC 2013


On Sat, 2013-12-14 at 15:26 +0400, Eugene Nikanorov wrote:
> Hi tempest folks,
> 
> While adding new API tests for Neutron I found out that network client
> used in tempest could be improved in at least two ways:
> 1) code duplication between xml and json versions could be removed
> 2) client API could be made more flexible and similar to real neutron
> client API. 
> E.g. instead of accepting fixed subset of properties of the resource,
> methods could accept full dict with resource description.
> 
> Implementing this two points will also require some changes in the
> tests: for example, instead of calling
>  network_client.create_network(name)
> test should call:
>  network_data = {'name': name, 'property2': property, ...}
>  network_client.create_network(network_data)
> 
> Those both items require quite a bit of work and I'm working on such
> improvement right now.
> My personal motivation for this is that I hate to add new client
> methods by copy-pasting existing and
> hardcoding stuff in them (and btw, I need to do it for both xml and
> json versions)
> 
> So before committing more than two hours on this, I wanted to ask if
> such kind of change is desirable?
> If so, I'm going to present a sequence of patches that will implement
> this plan.

Hi Eugene!

It's best to keep refactoring patches separate from any patches that add
functionality or new tests to Tempest. I think the above improvements
would be a welcome change, but it's easier for reviewers if that
refactoring patch is all in one patch and not mixed in with new tests or
added functionality.

All the best,
-jay




More information about the OpenStack-dev mailing list