[Koha-devel] Test case failures and database access

Colin Campbell colin.campbell at ptfs-europe.com
Thu Dec 9 11:03:36 CET 2010


On 08/12/10 05:58, Robin Sheat wrote:
> While attempting to put the packages for 3.2.1 together, I encountered a
> number of test cases that fail unless you have a database configured.
> This seems to be due to tests 'use'ing modules that attempt to connect
> to the database immediately, and therefore failing.
> 

> I'm after some opinions on how to best solve this. My ideas are:
> * Move these tests into a 'db_dependent' directory so that they aren't
> run by default. Perhaps add a 'make test_all' rule that includes them.
> * Have the packages move the iffy ones out of the way (although they
> will still fail for anyone running 'make test' without the database set
> up.)
> * Introduce an environment variable that is set during testing that
> tells C4::Context (or whatever it is making the DB connection) that
> failures are OK. This may reduce test coverage however, which we don't
> want.
I'm wondering if the last possibility might be enhanced by using
something like DBD::Mock.

Cheers
Colin

-- 
Colin Campbell
Chief Software Engineer,
PTFS Europe Limited
Content Management and Library Solutions
+44 (0) 208 366 1295 (phone)
+44 (0) 7759 633626  (mobile)
colin.campbell at ptfs-europe.com
skype: colin_campbell2

http://www.ptfs-europe.com


More information about the Koha-devel mailing list