[Openstack] [nova-testing] Efforts for Essex

Sandy Walsh sandy.walsh at RACKSPACE.COM
Tue Nov 22 19:40:50 UTC 2011


I'm not a big fan of faking a database, not only for the reasons outlined already, but because it makes the tests harder to understand.

I much prefer to mock the db call on a per-unit-test basis so you can see everything you need in a single file. Yes, this could mean some duplication across test suites. But that is better than changes to the fake busting some other test that has different assumptions. 

Are we testing the code or are we testing the fake?

(real) Unit tests are our documentation and having to jump around to find out how the plumbing works doesn't make for good documentation.

-S
________________________________________
From: openstack-bounces+sandy.walsh=rackspace.com at lists.launchpad.net [openstack-bounces+sandy.walsh=rackspace.com at lists.launchpad.net] on behalf of Soren Hansen [soren at linux2go.dk]
Sent: Tuesday, November 22, 2011 3:09 PM
To: Jay Pipes
Cc: openstack at lists.launchpad.net
Subject: Re: [Openstack] [nova-testing] Efforts for Essex

Ok, this seems like a good time to repeat what I posted to nova-database
the other day.

tl;dr: I'm adding a fake DB driver as well as a DB test suite that we
can run against any of the backends to verify that they act the same.
This should address all the concerns I've heard so far.

########################################################################
Hi.

I just want to let you know that I'm working on a fake DB driver. The
two primary goals are to reduce the time it takes to run the test
suite (my results so far are very impressive) and simply to have
another, independent DB implementation. Once I'm done, I'll start
adding tests for it all, and finally, I'll take a stab at adding an
alternative, real DB backend.

In case you're wondering why I don't write the tests first, it's
simply because I don't know how all these things are supposed to work.
I hope to have a much better understanding of this once I've written
the fake DB driver, and then I'll add a generic test suite that should
be able to validate any DB backend.
########################################################################


--
Soren Hansen        | http://linux2go.dk/
Ubuntu Developer    | http://www.ubuntu.com/
OpenStack Developer | http://www.openstack.org/

_______________________________________________
Mailing list: https://launchpad.net/~openstack
Post to     : openstack at lists.launchpad.net
Unsubscribe : https://launchpad.net/~openstack
More help   : https://help.launchpad.net/ListHelp




More information about the Openstack mailing list