[Koha-devel] Test case failures and database access

Robin Sheat robin at catalyst.net.nz
Wed Dec 8 06:58:47 CET 2010


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.

The tests I've noticed doing this are:
00-load.t
External_BakerTaylor.t
Reports_Guided.t
Service.t
Tags.t
UploadedFile.t
VirtualShelves_Page.t

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.

For now I'm going to make a patch that does the first one (and fixes
00-load.t so that it avoids loading the problematic ones) but I'm
interested to see if someone has other ideas or strong opinions on the
best way to do this.

This is tracked here:
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=5477

-- 
Robin Sheat
Catalyst IT Ltd.
✆ +64 4 803 2204
GPG: 5957 6D23 8B16 EFAB FEF8  7175 14D3 6485 A99C EB6D
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part
URL: </pipermail/koha-devel/attachments/20101208/190a027c/attachment.pgp>


More information about the Koha-devel mailing list