]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commit
Delete DB records instead of tables to speedup UT
authorKevin Benton <blak111@gmail.com>
Wed, 17 Sep 2014 00:29:51 +0000 (17:29 -0700)
committerKevin Benton <blak111@gmail.com>
Wed, 17 Sep 2014 16:05:49 +0000 (09:05 -0700)
commit34cf04a0ea84f4e5b32aa8d45108bd2a38bcff58
tree024598f558c9dfdd7483c3697519237f791d11d3
parent48ec1fbfc3a96e1bac36d9089895966dee249538
Delete DB records instead of tables to speedup UT

Now that the schema is fixed for all of the plugins,
there isn't a need to delete and recreate the entire
schema for every unit test.

This patch clears the tables at the end of each test
instead of deleting them. This eliminated overhead seems
to save 10%+ execution time of the entire set of unit
tests.

Example of performance gain from tox -epy27 tests.unit.ml2:
Before: Ran 2495 tests in 284.186s
After: Ran 2495 tests in 223.299s

Change-Id: Ic5bcbb0cf941e0745890abc776d719e58bb42e35
neutron/tests/unit/testlib_api.py