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
Robin Sheat schreef op wo 08-12-2010 om 18:58 [+1300]:
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.
And, I found that a directory for this already exists. Convenient :) -- Robin Sheat Catalyst IT Ltd. ✆ +64 4 803 2204 GPG: 5957 6D23 8B16 EFAB FEF8 7175 14D3 6485 A99C EB6D
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@ptfs-europe.com skype: colin_campbell2 http://www.ptfs-europe.com
participants (2)
-
Colin Campbell -
Robin Sheat