[openstack-dev] Nova + testr?

Monty Taylor mordred at inaugust.com
Sat Feb 2 07:13:59 UTC 2013



On 02/02/2013 04:10 PM, Joshua Harlow wrote:
> Howdy all,
> 
> Just was running the nova unit tests and getting used to the testr
> running and was wondering if there is anyway to see exactly what tests
> its running (since the nova tests take a long long time to complete).
> 
> Is this a feature that is hidden, or something that others have been
> using to do this.
> 
> Even having a simple progress bar would be nice, just to show that
> something is happening…
> 
> Right now it just goes into:
> 
> Running ` python setup.py testr --slowest --testr-args=' '`
> running testr
> running=OS_STDOUT_CAPTURE=1 OS_STDERR_CAPTURE=1 OS_TEST_TIMEOUT=60
> ${PYTHON:-python} -m subunit.run discover -t ./ ./nova/tests  
> 
> And stays like that for a long while, not the best CLI ui :-/
> 
> Anyone doing something that might improve that?

Yeah - there is a todo list item to support incremental output printing.
The main reason it's a todo item and not done already is that it gets
trickier to get it to be fully useful when we're running in parallel
mode (there's a plan, we've just been busy)

HOWEVER - this is a smart crowd, so I'm going to babble for a second.

When testr runs things, it's actually running them via the subunit test
runner, which runs python unittests and outputs their results in subunit
format. subunit is a language independent streaming test result
protocol, and testr is a test runner runner that handles things that
know how to deal with subunit.

If you'd like to see a VERY VERBOSE dump of everything that is
happening, do this:

testr run --subunit --full-results

You'll see the subunit stream that testr is consuming stream by. If you
want to track what's running (not success or failure) do this:

testr run --subunit --full-results | grep '^test:'

And you'll see a sequence of lines like this:

test:
nova.tests.api.ec2.test_cinder_cloud.CinderCloudTestCase.test_create_snapshot

If you want to see results:

testr run --subunit --full-results | grep -E
'^(successful|failure|error|skip|notsupported):'

Will get you test results.

NOW - that's great for a temp fix, and honestly, I could probably clean
that up just a smidge and put it into run_tests.sh ... but what we want
is something that sits between testr and subunit - because testr run
--parallel runs things in multiple processes and we want to make that
work right.

However, having just brain-vomited all of that, I've got an idea...
lemme write a quick patch...

Monty



More information about the OpenStack-dev mailing list