[openstack-dev] [qa] Checking for return codes in tempest client calls
Ghanshyam Mann
ghanshyam.mann at nectechnologies.in
Thu May 8 02:00:04 UTC 2014
Hi All,
>>2014-05-07 22:53 GMT+09:00 David Kranz <dkranz at redhat.com>:
>> I just looked at a patch https://review.openstack.org/#/c/90310/3
>> which was given a -1 due to not checking that every call to list_hosts
>> returns 200. I realized that we don't have a shared understanding or
>> policy about this. We need to make sure that each api is tested to
>> return the right response, but many tests need to call multiple apis
>> in support of the one they are actually testing. It seems silly to
>> have the caller check the response of every api call. Currently there
>> are many, if not the majority of, cases where api calls are made
>> without checking the response code. I see a few
>> possibilities:
>>
>> 1. Move all response code checking to the tempest clients. They are
>> already checking for failure codes and are now doing validation of
>> json response and headers as well. Callers would only do an explicit
>> check if there were multiple success codes possible.
>>
>> 2. Have a clear policy of when callers should check response codes and
>> apply it.
>>
>> I think the first approach has a lot of advantages. Thoughts?
>Thanks for proposing this, I also prefer the first approach.
>We will be able to remove a lot of status code checks if going on this direction.
>It is necessary for bp/nova-api-test-inheritance tasks also.
>Current https://review.openstack.org/#/c/92536/ removes status code checks because some Nova v2/v3 APIs return different codes and the codes are already checked in client side.
>but it is necessary to create a lot of patch for covering all API tests.
>So for now, I feel it is OK to skip status code checks in API tests only if client side checks are already implemented.
>After implementing all client validations, we can remove them of API tests.
I also like the first approach, where any missing of return code checking can be avoided.
Even we can have multiple return code check at client side in JSON schema. Currently we do not have any schema validation of any such API which return multiple success code.
For example server external events API returns multiple success code (200, 207), https://review.openstack.org/#/c/90655/ implement the test for that and Schema for this API response validation should have multiple return code check.
Thanks
Ghanshyam Mann
_______________________________________________
OpenStack-dev mailing list
OpenStack-dev at lists.openstack.org
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
DISCLAIMER:
-----------------------------------------------------------------------------------------------------------------------
The contents of this e-mail and any attachment(s) are confidential and
intended
for the named recipient(s) only.
It shall not attach any liability on the originator or NEC or its
affiliates. Any views or opinions presented in
this email are solely those of the author and may not necessarily reflect the
opinions of NEC or its affiliates.
Any form of reproduction, dissemination, copying, disclosure, modification,
distribution and / or publication of
this message without the prior written consent of the author of this e-mail is
strictly prohibited. If you have
received this email in error please delete it and notify the sender
immediately. .
-----------------------------------------------------------------------------------------------------------------------
More information about the OpenStack-dev
mailing list