[openstack-dev] [Network] The destiny of run_test.sh

Russell Bryant rbryant at redhat.com
Wed May 1 19:06:01 UTC 2013


On 04/30/2013 08:11 PM, Dan Smith wrote:
>> However, it seems there are a few arguments for keeping run_test.sh
>> alive.
> 
> Personally, I think it is important for all the projects to have an
> easy test runner script in the root. That script should run the tests
> in the configuration we expect to work, whatever that may be. If all it
> does is run tox, then that's fine, but I think it should be there. I
> think it's also important for that script to have the style checks
> available as well ("./run_tests.sh -p" does this for me right now).
> 

Seems like we could do a tox wrapper, if that's actually helpful ...
seems like just a README.tests could serve the same purpose, though.

Install tox:

    $ pip-python install tox

Run unit tests:

    $ tox -e py27

Run style checks:

    $ tox -e pep8

Run everything:

    $ tox

Note that running everything will also try to run the tests for the py26
environment.  If you don't have a Python 2.6 interpreter available, this
part will fail, but the rest will still run.

>> issues such as slowness because of sdist can be addressed. 
> 
> I'd love to know what we can do in this regard (at least for nova).
> Running a single test with tox takes a lot longer than it should just
> for the setup process :)

I believe this has been addressed.  The ChangeLog generation used to
generate diffstat for all commits, IIRC.  It was recently changed to not
do that anymore and that drastically sped up this part of the process.

One other thing that run_tests.sh can do is run tests without a
virtualenv at all.  I'm not sure how to do that with tox.  I never use
it, but I suspect it's useful for some, such as testing compatibility
with the versions of things included in a given distro.

-- 
Russell Bryant



More information about the OpenStack-dev mailing list