[Koha-bugs] [Bug 12603] TestBuilder - Module to simplify the writing of tests

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Wed Aug 20 12:25:03 CEST 2014


http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12603

--- Comment #10 from Martin Renvoize <martin.renvoize at ptfs-europe.com> ---
Comment on attachment 30086
  --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=30086
[SIGNED-OFF] Bug 12603: creating TestBuilder to simplify tests

Review of attachment 30086:
 --> (http://bugs.koha-community.org/bugzilla3/page.cgi?id=splinter.html&bug=12603&attachment=30086)
-----------------------------------------------------------------

I'm reasonably happy that the code does what it's meant to, and goes some way
toward making tests somewhat easier to write.

However, before accepting such a patch, I would like to see some efforts go
into encouraging it's adoption for writing future tests.

By this I mean, adding a bit of additional off bug documentation around it; for
instance a Wiki page clearly defining why using the module is a good idea,
'selling' it to other developers, and a clear set of use cases beyond
re-factoring of current passing tests.

My gut still feels that db dependant tests should go hand in hand with db
independent tests, so I'd still love to know if adding a Mock layer to this
might be achievable.

I'm also not sure the module name is especially descriptive.. I'de prefer
something like PopulateData or something.. I'll have a think on that one.  The
module isn't 'building tests for you' it's populating the database with
sensible stuff for you.

::: t/lib/TestBuilder.pm
@@ +320,5 @@
> +Koha module to insert the foreign keys automatically for the tests
> +
> +=head1 DESCRIPTION
> +
> +This module allows to insert automatically an entry in the database. All the database changes are wrapped in a transaction.

Perhaps change to: 'This module allows one to automatically populate the
database with all relevant entries required to test a particular area of
functionality. The chages are also wrapped in a transaction, to allow roll-back
upon test completion.'

@@ +322,5 @@
> +=head1 DESCRIPTION
> +
> +This module allows to insert automatically an entry in the database. All the database changes are wrapped in a transaction.
> +The foreign keys are created according to the DBIx::Class schema.
> +The taken values are the values by default if it is possible or randomly generated.

I'm not exactly sure what you mean here; could you clarify please?

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list