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

Sean Dague sean at dague.net
Thu Dec 5 12:52:06 UTC 2013

On 12/04/2013 06:59 PM, Brant Knudson wrote:
> In Keystone, we've got some tests that "raise self.skipTest('...')" in
> the test class setUp() method (not setUpClass). My testing shows that if
> there's several tests in the class then it shows all of those tests as
> skipped (not just 1 skip). Does this do what you want?
> Here's an example:
> http://git.openstack.org/cgit/openstack/keystone/tree/keystone/tests/test_ipv6.py?id=73dbc00e6ac049f19d0069ecb07ca8ed75627dd5#n30
> http://git.openstack.org/cgit/openstack/keystone/tree/keystone/tests/core.py?id=73dbc00e6ac049f19d0069ecb07ca8ed75627dd5#n500

Our skipIf on the method does the same thing, because we rarely have a
setUp. Realistically, Tempest tests are often a bit strange relative to
testing you will see in project trees. Because Tempest is running tests
on real resources, computes, cinder volumes, networks which can be very
expensive to setup. This means that the bulk of the time in tempest
tests is on setup.

As a bunch of these tests aren't destructive to those resources, we
cheat a little, and build them once in setUpClass. A naive convert to
setUp would probably increase the Tempest run times by a factor of 6 to
10. We have ideas about how to do a non naive convert... but it will be
late cycle at best.

All of this is a bit of a digression, but it seemed like useful context.


Sean Dague

-------------- 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/20131205/a31bee09/attachment.pgp>

More information about the OpenStack-dev mailing list