[openstack-dev] testr help

John Dennis jdennis at redhat.com
Fri Mar 7 22:13:45 UTC 2014


On 03/07/2014 04:30 PM, Clark Boylan wrote:

> Now onto indirectly answering some of the questions you have. If a
> single unittest is producing thousands of lines of log output that is
> probably a bug. The test scope is too large or the logging is too
> verbose or both. To work around this we probably need to make the
> fakeLogger fixture toggleable with configurable log level. Then you
> could do something like `OS_LOG_LEVEL=error tox` and avoid getting all
> of the debug level logs.
> 
> For examining test results you can `testr load $SUBUNIT_LOG_FILE` then
> run commands like `testr last`, `testr failing`, `testr slowest`, and
> `testr stats` against that run (if you want details on the last run
> you don't need an explicit load). There are also a bunch of tools that
> come with python-subunit like subunit-filter, subunit2pyunit,
> subunit-stats, and so on that you can use to do additional processing.

Thanks Clark!! That's great information it's helping me piece the pieces
together.

Here is where I think I'm stuck. The subunit test result stream seems to
have "details" which it attaches to the test result. For the failing
tests it often includes:

pythonlogging
stacktrace

Both very useful pieces of information. I don't want to get rid of them
in the test results because I'll make use of them while fixing problems.
Instead what I want to do is toggle the display of this extra detail
information on or off when I run any of the commands that show me test
results.

What I can't figure out is how to toggle the display of pythonlogging
and stacktrace on or off so that I can either get a simple summary or
full detail (but only when I need it).

I thought subunit-filter might be the right tool, but I don't see anyway
to toggle various pieces of detail data using that tool.

Once again, thanks for your help.

-- 
John



More information about the OpenStack-dev mailing list