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

2014-01-02 Thread John Garbutt
On 21 December 2013 13:24, Matt Riedemann wrote: > > > On 12/19/2013 8:51 AM, John Garbutt wrote: >> >> On 4 December 2013 17:10, Russell Bryant wrote: >>> >>> I think option 3 makes the most sense here (pending anyone saying we >>> should run away screaming from mox3 for some reason). It's actu

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

2013-12-23 Thread Ben Nemec
I added it to the page John linked earlier: https://wiki.openstack.org/wiki/ReviewChecklist -Ben On 2013-12-23 17:08, Shawn Hartsock wrote: > Where in the wiki is this written down? Maybe I should read some of these > entries. I have looked but I can't find it. > On Dec 23, 2013 11:56 AM

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

2013-12-23 Thread Shawn Hartsock
Where in the wiki is this written down? Maybe I should read some of these entries. I have looked but I can't find it. On Dec 23, 2013 11:56 AM, "Ben Nemec" wrote: > On 2013-12-21 07:24, Matt Riedemann wrote: > >> On 12/19/2013 8:51 AM, John Garbutt wrote: >> >>> On 4 December 2013 17:10, Russell

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

2013-12-23 Thread John Griffith
On Thu, Dec 5, 2013 at 8:38 PM, Jay Pipes wrote: > On 12/04/2013 12:10 PM, Russell Bryant wrote: >> >> On 12/04/2013 11:16 AM, Nikola Đipanov wrote: >>> >>> Resurrecting this thread because of an interesting review that came up >>> yesterday [1]. >>> >>> It seems that our lack of a firm decision o

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

2013-12-23 Thread Ben Nemec
On 2013-12-21 07:24, Matt Riedemann wrote: On 12/19/2013 8:51 AM, John Garbutt wrote: On 4 December 2013 17:10, Russell Bryant wrote: I think option 3 makes the most sense here (pending anyone saying we should run away screaming from mox3 for some reason). It's actually what I had been assumi

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

2013-12-21 Thread Matt Riedemann
On 12/19/2013 8:51 AM, John Garbutt wrote: On 4 December 2013 17:10, Russell Bryant wrote: I think option 3 makes the most sense here (pending anyone saying we should run away screaming from mox3 for some reason). It's actually what I had been assuming since this thread a while back. This m

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

2013-12-19 Thread John Garbutt
On 4 December 2013 17:10, Russell Bryant wrote: > I think option 3 makes the most sense here (pending anyone saying we > should run away screaming from mox3 for some reason). It's actually > what I had been assuming since this thread a while back. > > This means that we don't need to *require* th

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

2013-12-06 Thread Ben Nemec
On 2013-12-05 21:38, Jay Pipes wrote: On 12/04/2013 12:10 PM, Russell Bryant wrote: On 12/04/2013 11:16 AM, Nikola Đipanov wrote: Resurrecting this thread because of an interesting review that came up yesterday [1]. It seems that our lack of a firm decision on what to do with the mocking fra

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

2013-12-05 Thread Jay Pipes
On 12/04/2013 12:10 PM, Russell Bryant wrote: On 12/04/2013 11:16 AM, Nikola Đipanov wrote: Resurrecting this thread because of an interesting review that came up yesterday [1]. It seems that our lack of a firm decision on what to do with the mocking framework has left people confused. In hope

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

2013-12-04 Thread Matt Riedemann
On 12/4/2013 10:16 AM, Nikola Đipanov wrote: On 11/19/2013 05:52 PM, Peter Feiner wrote: On Tue, Nov 19, 2013 at 11:19 AM, Chuck Short wrote: Hi On Tue, Nov 19, 2013 at 10:43 AM, Peter Feiner wrote: A substantive reason for switching from mox to mock is the derelict state of mox release

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

2013-12-04 Thread Chuck Short
On Wed, Dec 4, 2013 at 11:16 AM, Nikola Đipanov wrote: > On 11/19/2013 05:52 PM, Peter Feiner wrote: > > On Tue, Nov 19, 2013 at 11:19 AM, Chuck Short > wrote: > >> Hi > >> > >> > >> On Tue, Nov 19, 2013 at 10:43 AM, Peter Feiner > wrote: > >>> > >>> A substantive reason for switching from mox

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

2013-12-04 Thread Nikola Đipanov
On 12/04/2013 06:15 PM, Peter Feiner wrote: > On Wed, Dec 4, 2013 at 11:16 AM, Nikola Đipanov wrote: >> 1) Figure out what is the deal with mox3 and decide if owning it will >> really be less trouble than porting nova. To be hones - I was unable to >> even find the code repo for it, only [3]. If a

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

2013-12-04 Thread Peter Feiner
On Wed, Dec 4, 2013 at 11:16 AM, Nikola Đipanov wrote: > 1) Figure out what is the deal with mox3 and decide if owning it will > really be less trouble than porting nova. To be hones - I was unable to > even find the code repo for it, only [3]. If anyone has more info - > please weigh in. We'll al

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

2013-12-04 Thread Russell Bryant
On 12/04/2013 11:16 AM, Nikola Đipanov wrote: > Resurrecting this thread because of an interesting review that came up > yesterday [1]. > > It seems that our lack of a firm decision on what to do with the mocking > framework has left people confused. In hope to help - I'll give my view > of where

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

2013-12-04 Thread Nikola Đipanov
On 11/19/2013 05:52 PM, Peter Feiner wrote: > On Tue, Nov 19, 2013 at 11:19 AM, Chuck Short > wrote: >> Hi >> >> >> On Tue, Nov 19, 2013 at 10:43 AM, Peter Feiner wrote: >>> >>> A substantive reason for switching from mox to mock is the derelict >>> state of mox releases. There hasn't been a rel

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

2013-11-19 Thread Peter Feiner
On Tue, Nov 19, 2013 at 11:19 AM, Chuck Short wrote: > Hi > > > On Tue, Nov 19, 2013 at 10:43 AM, Peter Feiner 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, wa

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

2013-11-19 Thread Chuck Short
Hi On Tue, Nov 19, 2013 at 10:43 AM, Peter Feiner 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, subst

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

2013-11-19 Thread Peter Feiner
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 ye

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

2013-11-13 Thread Matt Riedemann
On 11/12/2013 5:04 PM, Chuck Short wrote: On Tue, Nov 12, 2013 at 4:49 PM, Mark McLoughlin mailto:mar...@redhat.com>> wrote: On Tue, 2013-11-12 at 16:42 -0500, Chuck Short wrote: > > Hi > > > On Tue, Nov 12, 2013 at 4:24 PM, Mark McLoughlin mailto:mar...@red

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

2013-11-12 Thread Chuck Short
On Tue, Nov 12, 2013 at 4:49 PM, Mark McLoughlin wrote: > On Tue, 2013-11-12 at 16:42 -0500, Chuck Short wrote: > > > > Hi > > > > > > On Tue, Nov 12, 2013 at 4:24 PM, Mark McLoughlin > > wrote: > > On Tue, 2013-11-12 at 13:11 -0800, Shawn Hartsock wrote: > > > Maybe we should ha

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

2013-11-12 Thread Angus Salkeld
On 12/11/13 21:49 +, Mark McLoughlin wrote: On Tue, 2013-11-12 at 16:42 -0500, Chuck Short wrote: Hi On Tue, Nov 12, 2013 at 4:24 PM, Mark McLoughlin wrote: On Tue, 2013-11-12 at 13:11 -0800, Shawn Hartsock wrote: > Maybe we should have some 60% rule... that is: If you ch

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

2013-11-12 Thread Shawn Hartsock
12, 2013 4:41:47 PM > Subject: Re: [openstack-dev] [nova] Do we have some guidelines for mock, > stub, mox when writing unit test? > > On 2013-11-12 15:27, Shawn Hartsock wrote: > > Good point. > > > > I assume someone made a comparison similar to this: > >

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

2013-11-12 Thread Ben Nemec
On 2013-11-12 15:27, Shawn Hartsock wrote: Good point. I assume someone made a comparison similar to this: * http://garybernhardt.github.io/python-mock-comparison/ ... and evangelized a choice. I had assumed that Mock vs mox was not merely based on Python3 support but had something to do with M

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

2013-11-12 Thread Mark McLoughlin
On Tue, 2013-11-12 at 16:42 -0500, Chuck Short wrote: > > Hi > > > On Tue, Nov 12, 2013 at 4:24 PM, Mark McLoughlin > wrote: > On Tue, 2013-11-12 at 13:11 -0800, Shawn Hartsock wrote: > > Maybe we should have some 60% rule... that is: If you change > more than >

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

2013-11-12 Thread Chuck Short
From: "Mark McLoughlin" > > To: "Shawn Hartsock" > > Cc: "OpenStack Development Mailing List (not for usage questions)" < > openstack-dev@lists.openstack.org> > > Sent: Tuesday, November 12, 2013 4:24:08 PM > > Subject: Re: [openstack-

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

2013-11-12 Thread Chuck Short
; , "OpenStack Development > Mailing List (not for usage questions)" > > > > > > Sent: Tuesday, November 12, 2013 9:31:25 AM > > > Subject: Re: [openstack-dev] [nova] Do we have some guidelines for > mock, stub, mox when writing unit test? > > > > >

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

2013-11-12 Thread Shawn Hartsock
ss the codebase? > > Mark. > > > - Original Message - > > > From: "John Garbutt" > > > To: "Mark McLoughlin" , "OpenStack Development Mailing > > > List (not for usage questions)" > > > > > > Sent: Tuesday, No

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

2013-11-12 Thread Mark McLoughlin
estions)" > > > > Sent: Tuesday, November 12, 2013 9:31:25 AM > > Subject: Re: [openstack-dev] [nova] Do we have some guidelines for mock, > > stub, mox when writing unit test? > > > > On 11 November 2013 23:18, Mark McLoughlin wrote: > > > On Mon,

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

2013-11-12 Thread Shawn Hartsock
Mailing > List (not for usage questions)" > > Sent: Tuesday, November 12, 2013 9:31:25 AM > Subject: Re: [openstack-dev] [nova] Do we have some guidelines for mock, > stub, mox when writing unit test? > > On 11 November 2013 23:18, Mark McLoughlin wrote: > > On Mon, 201

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

2013-11-12 Thread John Garbutt
On 11 November 2013 23:18, Mark McLoughlin wrote: > On Mon, 2013-11-11 at 12:07 +, John Garbutt wrote: >> On 11 November 2013 10:27, Rosa, Andrea (HP Cloud Services) >> wrote: >> > Hi >> > >> >>Generally mock is supposed to be used over mox now for python 3 support. >> > >> > That is my under

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

2013-11-11 Thread Mark McLoughlin
On Mon, 2013-11-11 at 12:07 +, John Garbutt wrote: > On 11 November 2013 10:27, Rosa, Andrea (HP Cloud Services) > wrote: > > Hi > > > >>Generally mock is supposed to be used over mox now for python 3 support. > > > > That is my understanding too > > +1 > > But I don't think we should waste

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

2013-11-11 Thread Jay Lau
Got it. Thanks. Jay 2013/11/11 Davanum Srinivas > Feedback from some of the Nova sessions were, > > "If you are writing new tests, try to use mock." > "Writing new tests to cover more code (esp drivers) is more preferable > to any effort that just converts from mox to mock" > > -- dims > > On

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

2013-11-11 Thread John Garbutt
On 11 November 2013 10:27, Rosa, Andrea (HP Cloud Services) wrote: > Hi > >>Generally mock is supposed to be used over mox now for python 3 support. > > That is my understanding too +1 But I don't think we should waste all our time re-writing all our mox and stub tests. Lets just leave this to h

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

2013-11-11 Thread Rosa, Andrea (HP Cloud Services)
Hi >Generally mock is supposed to be used over mox now for python 3 support. That is my understanding too >As for when to use mock vs stubs, I think you'll get different opinions from >different people. Stubs are quick and easy and that's what I used early when I >started contributing to the pr

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

2013-11-10 Thread Davanum Srinivas
Feedback from some of the Nova sessions were, "If you are writing new tests, try to use mock." "Writing new tests to cover more code (esp drivers) is more preferable to any effort that just converts from mox to mock" -- dims On Sun, Nov 10, 2013 at 11:25 PM, Noorul Islam K M wrote: > Jay Lau w

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

2013-11-10 Thread Noorul Islam K M
Jay Lau writes: > Hi, > > I noticed that we are now using mock, mox and stub for unit test, just > curious do we have any guidelines for this, in which condition shall we use > mock, mox or stub? > There is already a blueprint [1] in Nova project to replace Mox with mock. Also it has a link to

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

2013-11-10 Thread Matt Riedemann
I don't see anything explicit in the wiki and hacking guides, they mainly just say to have unit tests for everything and tell you how to run/debug them. Generally mock is supposed to be used over mox now for python 3 support. There is also a blueprint to remove the usage of mox in neutron: ht

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

2013-11-10 Thread Boris Pavlovic
Jay, I am not 100% sure. But personally for me mock are the best choice. 1) py3 support 2) simple for usage. Best regards, Boris Pavlovic --- Mirantis Inc. On Sun, Nov 10, 2013 at 5:40 PM, Jay Lau wrote: > Hi, > > I noticed that we are now using mock, mox and stub for unit test, just > cu

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

2013-11-10 Thread Jay Lau
Hi, I noticed that we are now using mock, mox and stub for unit test, just curious do we have any guidelines for this, in which condition shall we use mock, mox or stub? Thanks, Jay ___ OpenStack-dev mailing list OpenStack-dev@lists.openstack.org http: