[Koha-devel] Re: interest in improving automated tests with a testing database

Andrew Moore andrew.moore at liblime.com
Fri Apr 18 18:18:18 CEST 2008


Hi again Koha developers -

Galen and I just submitted a few patches that implement this new
testing method. I'm interested in any feedback you have before they're
committed.

http://lists.koha.org/pipermail/koha-patches/2008-April/000172.html
http://lists.koha.org/pipermail/koha-patches/2008-April/000171.html
http://lists.koha.org/pipermail/koha-patches/2008-April/000173.html
http://lists.koha.org/pipermail/koha-patches/2008-April/000174.html
http://lists.koha.org/pipermail/koha-patches/2008-April/000175.html

These create a new t/Makefile which runs a t/database_dependent.pl
test script which creates a test database and runs some automated
tests against it. Those tests are in the new t/lib directory and use
Test::Class to organize and run them.

The way that you use this is to re-run the top level 'perl
Makefile.PL' which will prompt you for some information about a test
database that can be built. Then, you can 'cd t' and run 'make test'
in there. This will make sure that your new test database is created
and used for the test suite. I expect that eventually this process
will be made easier, but this is a first stab at a solution, and I'm
trying to avoid interfering with normal installation as much as
possible.

I'm interested in hearing suggestions about how the process of setting
up the database and running the zebra stuff works. I'm also interested
in hearing about any of these tests that fail. I may take the
opportunity to fix some of these before the code is committed, or fix
them later.

Thanks for your help.
-Andy



On Thu, Mar 27, 2008 at 1:43 PM, Andrew Moore <andrew.moore at liblime.com> wrote:
> Hi Koha developers -
>
>  I have caught some of you on IRC and such, but for the rest of you,
>  I'm a new developer at LibLime working on Koha.
>
>  I'm interested in improving the automated test suite a little bit, and
>  I'm hoping to get some feedback from any interested developers and
>  users. There are some database specific tests in the t/db_dependent
>  directory, but I think they can be improved quite a bit. I'll lay out
>  what I'm picturing, and please let me know if you picture a different
>  plan, or have any ways to improve this one.
>
>  I'd like to have a 'make' target similar to 'make test' that would
>  build a nearly empty, skeleton database that we could run some
>  automated tests against. Since this would not be the same database
>  that live data is held in, we wouldn't have to worry about deleting or
>  overwriting any useful data. The testing could insert example data and
>  data known to trigger past bugs to ensure that they don't recur. I
>  don't imagine making this a standard part of 'make test', at least at
>  first, since I don't imagine that all end users want to have a second
>  database built just to test against. I think it could be immensely
>  useful for us developers, though, right away.
>
>  One useful way I've seen this done in the past is trough the use of
>  the Test::Class perl module. It's similar to the xUnit framework (or
>  jUnit or nUnit) in that it lets you run a bit of code before and after
>  each test to set up the environment (the test fixture). That way, you
>  can ensure that the database looks clean between when different pieces
>  of the test suite runs so that one test script doesn't interfere with
>  another. It also lets your test scripts inherit from each other so
>  that similar test scripts can share the same code to set up their
>  fixtures.
>
>  I have a small working prototype of this, but before I get much
>  further, I want to ask if you have any suggestions or advice for this.
>  Please let me know if this sounds like something that would be useful
>  to you, and if there's anything I need to make sure I consider.
>
>  Thanks,
>  -Andy
>


_______________________________________________
Koha-devel mailing list
Koha-devel at nongnu.org
http://lists.nongnu.org/mailman/listinfo/koha-devel



More information about the Koha-devel mailing list