[openstack-dev] Why no test DB ?

Matthew Sherborne msherborne at gmail.com
Mon Dec 10 20:27:21 UTC 2012


Here's the one that made my think it's done everywhere, but even this test
case has both styles:

https://github.com/openstack/nova/blob/master/nova/tests/api/openstack/compute/contrib/test_hosts.py#L116

So the 'use the DB' style is better eh ?


On Mon, Dec 10, 2012 at 2:02 PM, Monty Taylor <mordred at inaugust.com> wrote:

> Hi!
>
> We do this already. Every test in Nova creates a new in-memory sqlite
> database.
>
> In addition - on a machine with a proper config (which we detect) we
> have a couple of tests which check some things against a MySQL database
> (mainly to ensure that we properly create tables as InnoDB)
>
> Can you point towards something that does not do this?
>
> Monty
>
> On 12/09/2012 03:59 PM, Matthew Sherborne wrote:
> > Why don't we create and destroy a test sqlite in memory database for the
> > tests instead of stubbing out the DB calls ?
> >
> > *Pros:*
> > More thorough testing
> > More straight forward testing (create records instead of whole mock
> > structures)
> > Easier to create new tests, no need to stub everything out again, just
> > use the base test DB
> >
> > *Cons:*
> > Probably slower tests
> >
> > Has anyone looked at this in the past ?
> >
> > All comments appreciated.
> >
> > Kind Regards,
> > Matthew Sherborne
> >
> >
> > _______________________________________________
> > OpenStack-dev mailing list
> > OpenStack-dev at lists.openstack.org
> > http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
> >
>
> _______________________________________________
> OpenStack-dev mailing list
> OpenStack-dev at lists.openstack.org
> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack-dev/attachments/20121211/0694b80d/attachment.html>


More information about the OpenStack-dev mailing list