[openstack-dev] [neutron] questions about uni test

2016-01-25 Thread Gareth
Hey neutron guys

What will happen if I remove this line[0]?

When running unit test, do we create tables in real database?

[0] 
https://github.com/openstack/neutron/blob/master/neutron/tests/unit/testlib_api.py#L78

-- 
Gareth (Kun Huang)

Cloud Computing, OpenStack, Distributed Storage, Fitness, Basketball
OpenStack contributor, kun_huang@freenode
My promise: if you find any spelling or grammar mistakes in my email
from Mar 1 2013, notify me
and I'll donate $1 or ¥1 to an open organization you specify.

__
OpenStack Development Mailing List (not for usage questions)
Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


Re: [openstack-dev] [neutron] questions about uni test

2016-01-25 Thread Henry Gessau
Gareth  wrote:
> It creates and cleans the tables in memory?

Creates and deletes actually.

Line 69 creates all the tables when a test starts.

Line 78 uses the unittest framework to add the function clear_tables() to the
post-test operations that are run after every test. So after a test finishes,
all the tables will be deleted by line 76.


Neutron's unit test framework uses a sqlite in-memory database, yes. This is
configured by [1].

[1]
https://github.com/openstack/neutron/blob/master/neutron/tests/etc/neutron.conf#L26


> 
> On Tue, Jan 26, 2016 at 12:56 AM, Assaf Muller  wrote:
>> On Mon, Jan 25, 2016 at 10:05 AM, Gareth  wrote:
>>> Hey neutron guys
>>>
>>> What will happen if I remove this line[0]?
>>>
>>> When running unit test, do we create tables in real database?
>>>
>>> [0] 
>>> https://github.com/openstack/neutron/blob/master/neutron/tests/unit/testlib_api.py#L78
>>
>> That line has nothing to do with what database backend you use (SQLite
>> or mysql or whatever), it's used to clear the contents of the tables
>> so the next test starts with a clean DB.
>>
>>>
>>> --
>>> Gareth (Kun Huang)
>>>
>>> Cloud Computing, OpenStack, Distributed Storage, Fitness, Basketball
>>> OpenStack contributor, kun_huang@freenode
>>> My promise: if you find any spelling or grammar mistakes in my email
>>> from Mar 1 2013, notify me
>>> and I'll donate $1 or ¥1 to an open organization you specify.
>>>
>>> __
>>> OpenStack Development Mailing List (not for usage questions)
>>> Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe
>>> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
>>
>> __
>> OpenStack Development Mailing List (not for usage questions)
>> Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe
>> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
> 
> 
> 


__
OpenStack Development Mailing List (not for usage questions)
Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


Re: [openstack-dev] [neutron] questions about uni test

2016-01-25 Thread Assaf Muller
On Mon, Jan 25, 2016 at 10:05 AM, Gareth  wrote:
> Hey neutron guys
>
> What will happen if I remove this line[0]?
>
> When running unit test, do we create tables in real database?
>
> [0] 
> https://github.com/openstack/neutron/blob/master/neutron/tests/unit/testlib_api.py#L78

That line has nothing to do with what database backend you use (SQLite
or mysql or whatever), it's used to clear the contents of the tables
so the next test starts with a clean DB.

>
> --
> Gareth (Kun Huang)
>
> Cloud Computing, OpenStack, Distributed Storage, Fitness, Basketball
> OpenStack contributor, kun_huang@freenode
> My promise: if you find any spelling or grammar mistakes in my email
> from Mar 1 2013, notify me
> and I'll donate $1 or ¥1 to an open organization you specify.
>
> __
> OpenStack Development Mailing List (not for usage questions)
> Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe
> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev

__
OpenStack Development Mailing List (not for usage questions)
Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


Re: [openstack-dev] [neutron] questions about uni test

2016-01-25 Thread Gareth
It creates and cleans the tables in memory?

On Tue, Jan 26, 2016 at 12:56 AM, Assaf Muller  wrote:
> On Mon, Jan 25, 2016 at 10:05 AM, Gareth  wrote:
>> Hey neutron guys
>>
>> What will happen if I remove this line[0]?
>>
>> When running unit test, do we create tables in real database?
>>
>> [0] 
>> https://github.com/openstack/neutron/blob/master/neutron/tests/unit/testlib_api.py#L78
>
> That line has nothing to do with what database backend you use (SQLite
> or mysql or whatever), it's used to clear the contents of the tables
> so the next test starts with a clean DB.
>
>>
>> --
>> Gareth (Kun Huang)
>>
>> Cloud Computing, OpenStack, Distributed Storage, Fitness, Basketball
>> OpenStack contributor, kun_huang@freenode
>> My promise: if you find any spelling or grammar mistakes in my email
>> from Mar 1 2013, notify me
>> and I'll donate $1 or ¥1 to an open organization you specify.
>>
>> __
>> OpenStack Development Mailing List (not for usage questions)
>> Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe
>> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
>
> __
> OpenStack Development Mailing List (not for usage questions)
> Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe
> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev



-- 
Gareth (Kun Huang)

Cloud Computing, OpenStack, Distributed Storage, Fitness, Basketball
OpenStack contributor, kun_huang@freenode
My promise: if you find any spelling or grammar mistakes in my email
from Mar 1 2013, notify me
and I'll donate $1 or ¥1 to an open organization you specify.

__
OpenStack Development Mailing List (not for usage questions)
Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev