← Back to team overview

openstack team mailing list archive

Re: Test Frameworks ...

 

Hi Sandy! Comments inline :)

On Mon, Nov 22, 2010 at 8:37 AM, Sandy Walsh <sandy.walsh@xxxxxxxxxxxxx> wrote:
> Hi y'all,
> I'm working on the Admin API blueprint
> https://blueprints.launchpad.net/nova/+spec/admin-only-api
> And while looking at the code I discovered that the openstack API unittests
> were only available via nosetests and don't get run from runtests.py. The
> reason being that nosetests uses an auto-discovery mechanism, while py2.6
> unittest has no such mechanism. The openstack api has the only sub-module
> tests currently in nova. I'm sure there will be more. To make these tests
> compatible with unittest isn't a difficult task.
> unittest2 (a backport of py2.7+/3.x unittest) does bring this functionality
> to py2.6. Soren quoted Robert Clarke about not using nose (I think this blog
> post covers his

s/Clarke/Collins/ :) His IRC nick is "lifeless" on Freenode.

> concerns): http://www.advogato.org/person/robertc/diary.html?start=126 Nose
> also has more readable asserts, but we don't seem to be utilizing them
> currently.

True, though we could :)

> This made me question our use of nose.
> From IRC over the weekend I learned of some nose perks:
> <joshuamckenty> two or three reasons I like it
> <joshuamckenty> 1. dump to pdb on error
> <joshuamckenty> 2. log and stdout capture
> <joshuamckenty> 3. coverage metrics
> <joshuamckenty> 4. xunit output for hudson graphs
> <joshuamckenty> (I haven't looked into how many of those we could get
> elsewhere)
> Which are all very good features to have.

Indeed.

> I have no preference of test framework, but would like to know what the
> sanctioned approach is?
> 1. Assume nose drives the tests ... and we can use its extended features
> 2. Assume nose drives the tests ... but we must remain backward compatible
> with unittest
> 3. Assume unittest drives the tests (don't assume auto-discovery is
> available)
> 4. Assume unittest2 drives the tests (uses 2.7+ auto-discovery)
> 5. Something else?
> And if Twisted is going away, perhaps Trial is going away? How does this
> affect our decision?
> Perhaps given our extensive use of third-party libraries and the Continuous
> Integration/Metrics demands we have, standardizing on nose and modifying
> run_tests to launch nosetests seems appropriate (opt#1)?

I would prefer option #1 and to get rid of run_tests.py entirely.
With nose, it's not useful at all.  So, I would change the
run_tests.sh script to run nosetests instead of run_tests.py...this is
actually what we've already done in the Glance project (which uses
many common Nova modules, but not the test runner)

-jay

> Thoughts?
> -Sandy
>
> Confidentiality Notice: This e-mail message (including any attached or
> embedded documents) is intended for the exclusive and confidential use of
> the
> individual or entity to which this message is addressed, and unless
> otherwise
> expressly indicated, is confidential and privileged information of
> Rackspace.
> Any dissemination, distribution or copying of the enclosed material is
> prohibited.
> If you receive this transmission in error, please notify us immediately by
> e-mail
> at abuse@xxxxxxxxxxxxx, and delete the original message.
> Your cooperation is appreciated.
>
> _______________________________________________
> Mailing list: https://launchpad.net/~openstack
> Post to     : openstack@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~openstack
> More help   : https://help.launchpad.net/ListHelp
>
>



Follow ups

References