[openstack-dev] [Tempest] Which is the best way for skipping tests?

Sean Dague sean at dague.net
Wed Dec 4 16:05:23 UTC 2013


On 12/04/2013 09:24 AM, Joe Hakim Rahme wrote:
> I am in favor of class level exceptions for the obvious reasons:
> 
> + It reduces code duplication. Copy/pasting a SkipIf decorator on every test
>   method in the class is tedious and possibly error prone. Adding the exception
>   as a guard in the setUpClass() makes for a more elegant solution
> 
> + function level skips will waste unnecessary time in the setup/teardown
>   methods. If I know I'm skipping all the tests in a class, why should I bother
>   executing all the boilerplate preliminary actions? In the context of heavy
>   use, like the CI gate, this can accumulate and be a pain.
> 
> + Using function level skips requires importing an extra module (from testtools
>   import SkipIf) that would be otherwise unnecessary.
> 
> If the output of the class level skipException needs to be improved, maybe there
> should be a patch there to list all the methods skipped.
> 
> If proper fixtures are meant to replace setUpClass in the future (something I
> would really love to see in Tempest), we still need to take into account that
> setUpClass might do more than just fixtures, and certain guards are expected to
> be found in there.
> 
> What do you guys think?

So I'd be ok with a compromise, which would build a decorator for the
setUpClass method, at least that would make it easier to refactor out later.

That will require someone signing up to writing that though.

	-Sean

-- 
Sean Dague
http://dague.net

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 482 bytes
Desc: OpenPGP digital signature
URL: <http://lists.openstack.org/pipermail/openstack-dev/attachments/20131204/6966d38c/attachment.pgp>


More information about the OpenStack-dev mailing list