atom feed10 messages in org.openstack.lists.openstack-dev[openstack-dev] [nova] fastest way to...
FromSent OnAttachments
Daniel P. BerrangeJun 12, 2014 3:59 am 
Sean DagueJun 12, 2014 4:07 am 
Daniel P. BerrangeJun 12, 2014 4:17 am 
Vishvananda IshayaJun 20, 2014 8:30 am 
Matt RiedemannJul 9, 2014 1:51 pm 
Mike BayerJul 10, 2014 8:58 am 
Chris DentJul 10, 2014 9:08 am 
Mike BayerJul 10, 2014 9:23 am 
melanie wittJul 10, 2014 1:50 pm 
Nikola ĐipanovJul 11, 2014 1:24 am 
Subject:[openstack-dev] [nova] fastest way to run individual tests ?
From:Daniel P. Berrange (berr@redhat.com)
Date:Jun 12, 2014 3:59:56 am
List:org.openstack.lists.openstack-dev

When in the middle of developing code for nova I'll typically not wish to the run the entire Nova test suite every time I have a bit of code to verify. I'll just want to run the single test case that deals with the code I'm hacking on.

I'm currently writing a 'test_hardware.py' test case for the NUMA work I'm dealing with. I can run that using 'run_tests.sh' or 'tox' by just passing the name of the test case. The test case in question takes a tiny fraction of a second to run, but the tox command above wastes 32 seconds faffing about before it runs the test itself, while run_tests.sh is not much better wasting 22 seconds.

# tox -e py27 tests.virt.test_hardware ...snip... real 0m32.923s user 0m22.083s sys 0m4.377s

# time ./run_tests.sh tests.virt.test_hardware ...snip... real 0m22.075s user 0m14.282s sys 0m1.407s

This is a really severe time penalty to incurr each time I want to run this tiny test (which is very frequently during dev).

Does anyone have any tip on how to actually run individual tests in an efficient manner. ie something that adds no more than 1 second penalty over & above the time to run the test itself. NB, assume that i've primed the virtual env with all prerequisite deps already.

Regards, Daniel