← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1099694] Re: parallelize unit tests

 

** Changed in: quantum
       Status: Fix Committed => Fix Released

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to quantum.
https://bugs.launchpad.net/bugs/1099694

Title:
  parallelize unit tests

Status in OpenStack Quantum (virtual network service):
  Fix Released

Bug description:
  It would be nice if we also did this for quantum as well to speed up
  the unit tests.

  Hello,

  The change (https://review.openstack.org/15078) to make testr Nova's
  test runner merged in the last hour or so. What does this mean?

  * Nova's unittests will now be run in X parallel processes where X is
    the number of CPUs available on your machine (which results in much
    faster testing).
  * Parallel testing means you cannot count on your tests being run in
    the same order each time they are run or in the same process. Tests
    should be independent units.
    * Make sure you subclass nova.test.TestCase for your test classes to
      pull in the proper base setUp and tearDown stuff.
    * Use fixtures.Fixture to build robust fixtures that properly set
      and reset state before and after each test.
  * Virtual envs will need to be rebuilt as dependencies have changed.
  * Each test run is logged in subunit under .testrepository/$TEST_RUN_NUMBER.
    * Every test run during the test run will be captured in this log.
    * For each test in this log you will find the captured stdout,
      stderr, and logging for when that test was run (this content is also
      echoed to stdout when a test fails).
  * Running tests shouldn't change too much. tox -epy2X will still work
    and most of the run_tests.sh functionality was preserved.
    * For more info on running tests see http://wiki.openstack.org/testr.
  * The logs provided by Jenkins will include the console log and an
    html page with test details (that does not change). You will also find
    the subunit log for that test run.

  This is a semi large change and there are differences between nose and
  testr, non python2.6 test facilities like setUpClass will no longer be
  available under python2.6 for example. But most of these changes
  should be positive. Tests run faster, each test comes with very
  verbose logs, tests end up being more robust as testr shouldn't have
  the zero tests run but pass anyways problem. Additionally, because
  tests are run in different orders and in parallel, testr will often
  catch things like missing imports or conflicts between test cases (in
  fact most of the work involved in making this happen was in fixing
  test bugs).

  It would be great if other projects used
  https://review.openstack.org/15078 as a template for switching over to
  testr as well. Let me know if you have questions.

  Thanks,
  Clark

To manage notifications about this bug go to:
https://bugs.launchpad.net/quantum/+bug/1099694/+subscriptions