[openstack-dev] [nova] Do we have some guidelines for mock, stub, mox when writing unit test?

Peter Feiner peter at gridcentric.ca
Tue Nov 19 16:52:49 UTC 2013


On Tue, Nov 19, 2013 at 11:19 AM, Chuck Short <chuck.short at canonical.com> wrote:
> Hi
>
>
> On Tue, Nov 19, 2013 at 10:43 AM, Peter Feiner <peter at gridcentric.ca> wrote:
>>
>> A substantive reason for switching from mox to mock is the derelict
>> state of mox releases. There hasn't been a release of mox in three
>> years: the latest, mox-0.5.3, was released in 2010 [1, 2]. Moreover,
>> in the past 3 years, substantial bugs have been fixed in upstream mox.
>> For example, with the year-old fix to
>> https://code.google.com/p/pymox/issues/detail?id=16, a very nasty bug
>> in nova would have been caught by an existing test [3].
>>
>> Alternatively, a copy of the upstream mox code could be added in-tree.
>>
> Please no, I think we are in an agreement with mox3 and mock.

That's cool. As long as the mox* is phased out, the false-positive
test results will be fixed.

Of course, there's _another_ alternative, which is to retrofit mox3
with the upstream mox fixes (e.g., the bug I cited above exists in
mox3). However, the delta between mox3 and upstream mox is pretty huge
(I just checked), so effort is probably better spent switching to
mock. To that end, I plan on changing the tests I cited above.



More information about the OpenStack-dev mailing list