[openstack-dev] [Horizon] Some thoughts about Horizon's test suite
Richard Jones
r1chardj0n3s at gmail.com
Fri Aug 29 02:22:13 UTC 2014
I'm relatively new to Horizon, but I come with a bunch of experience with
Python more generally. I've contributed a couple of small patches to
Horizon in an effort to get more familiar with the codebase. Julie Pichon's
blog post about testing in Horizon has been invaluable <
http://www.jpichon.net/blog/2013/07/testing-in-horizon/>.
Very recently I attempted to fix a simple bug in which a Panel was being
displayed when it shouldn't have been. The resultant 5-line fix ended up
breaking 498 of the 1048 unit tests in the suite. I estimated that it would
take about a week's effort to address all the failing tests. For more
information see <
http://mechanicalcat.net/richard/log/Python/When_testing_goes_bad>
In talking about the issues I've hit I found quite a few people both in
#openstack-horizon and other places who are quite forthright in their
desire to get rid of all use of mox. I heartily endorse this motion.
Indeed, I would be willing to start the process of weeding mox out of the
suite entirely, one test module at a time, if there is support for such an
effort from Horizon core/TL.
Removing mox is one (admittedly very large) piece of the puzzle though. As
I mentioned in my blog post, there are other structural issues that would
need to be addressed also; the use of unittest.TestCase and the varying
methods of mocking.
At the moment, making a fix like the one I attempted is prohibitively
expensive to do, and thus won't be done because Horizon's test suite has
become too restrictive to change (unnecessarily so). I'd like to see that
change.
Richard
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack-dev/attachments/20140829/e57d6e57/attachment.html>
More information about the OpenStack-dev
mailing list