[Openstack] Test Frameworks ...

Sandy Walsh sandy.walsh at RACKSPACE.COM
Mon Nov 22 13:37:45 UTC 2010


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 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.

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.

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)?

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 at rackspace.com, and delete the original message. 
Your cooperation is appreciated.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack/attachments/20101122/e539ef9e/attachment.html>


More information about the Openstack mailing list