[Bug 13906] New: TestObjectFactory(ies) for Koha objects. Enable easy Test object creation from HASHes or from preconfigured test groups.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13906 Bug ID: 13906 Summary: TestObjectFactory(ies) for Koha objects. Enable easy Test object creation from HASHes or from preconfigured test groups. Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Test Suite Assignee: chris@bigballofwax.co.nz Reporter: olli-antti.kivilahti@jns.fi QA Contact: gmcharlt@gmail.com -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13906 --- Comment #1 from Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> --- Created attachment 37216 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=37216&action=edit Bug 13906 - TestObjectFactory(ies) for Koha objects. Enable easy Test object creation from HASHes or from preconfigured test groups. In discussion. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13906 Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |kyle@bywatersolutions.com -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13906 Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |In Discussion -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13906 Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #37216|0 |1 is obsolete| | --- Comment #2 from Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> --- Created attachment 40071 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=40071&action=edit Bug 13906 - TestObjectFactory(ies) for Koha objects. Enable easy Test object creation from HASHes or from preconfigured test groups. In discussion. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13906 Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #40071|0 |1 is obsolete| | --- Comment #3 from Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> --- Created attachment 40072 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=40072&action=edit Bug 13906 - TestObjectFactory(ies) for Koha objects. Enable easy Test object creation from HASHes or from preconfigured test groups. In discussion. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13906 Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |9525 -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13906 --- Comment #4 from Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> --- Created attachment 40078 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=40078&action=edit Bug 13906 - Cucumber tests. See Cucumber/testsStructuring.tutorial for more info -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13906 Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #40072|0 |1 is obsolete| | --- Comment #5 from Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> --- Created attachment 41021 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=41021&action=edit Bug 13906 - TestObjectFactory(ies) for Koha objects. Enable easy Test object creation from HASHes or from preconfigured test groups. Doing tests should be easy. One biggest hindrance in doing tests is the difficulty of doing so in Koha. We use a lot of hard-coded SQL, which occasionally requires quite a bit of fiddling to get it right. Satisfying complex object dependency chains is hard. For example, testing Overdue notice sending, one must create -letters -overuderules -circulationrules -borrowers -biblios -items -issues (checkouts) ... Also one must take care to clean up the database modifications afterward to make encapsulated tests which don't leak over other tests. This is especially so for front-end testing. TestObjectFactories significantly alleviate this pain, by offering preconfigured test object groups or enable creating test objects on demand. They try to recover from errors, like when the previous test crashed and left testing objects into the DB, preventing adding them again. Also they store what object they created to 3 different levels of stashes to facilitate complex test configurations, and they have the dignity to clean-up the test contexts after testing has happened (if the script doesn't crash)! USAGE: use t::db_dependent::TestObjects::Borrowers::BorrowerFactory; %#Setting up the test context my $testContext = {}; my $password = '1234'; my $borrowerFactory = t::db_dependent::TestObjects::Borrowers::BorrowerFactory->new(); my $borrowers = $borrowerFactory->createTestGroup([ {firstname => 'Olli-Antti', surname => 'Kivi', cardnumber => '1A01', branchcode => 'CPL', flags => '1', #superlibrarian, not exactly a very good way of doing permission testing? userid => 'mini_admin', password => $password, }, ], undef, $testContext); %#Test context set, starting testing: eval { ... #Run your tests here }; if ($@) { #Catch all leaking errors and gracefully terminate. warn $@; tearDown(); exit 1; } %#All tests done, tear down test context tearDown(); done_testing; sub tearDown { t::db_dependent::TestObjects::ObjectFactory->tearDownTestContext($testContext); } -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13906 Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #40078|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13906 Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|chris@bigballofwax.co.nz |olli-antti.kivilahti@jns.fi -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13906 Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |14536 Referenced Bugs: http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14536 [Bug 14536] PageObject-pattern base implementation -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13906 Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |14540 Referenced Bugs: http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14540 [Bug 14540] Move member-flags.pl to PermissionsManager to better manage permissions for testing. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13906 Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #41021|0 |1 is obsolete| | --- Comment #6 from Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> --- Created attachment 41119 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=41119&action=edit Bug 13906 - TestObjectFactory(ies) for Koha objects. Enable easy Test object creation from HASHes or from preconfigured test groups. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13906 Zeno Tajoli <z.tajoli@cineca.it> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |z.tajoli@cineca.it --- Comment #7 from Zeno Tajoli <z.tajoli@cineca.it> --- Hi Olli, If I try to see the tree of your bugs I see this the first bug to sent master to fix the others. This is your bugs tree for authentication rewrite: https://trello.com/b/o3uAES9s Why is in discussion ? -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13906 --- Comment #8 from Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> --- (In reply to Zeno Tajoli from comment #7)
Hi Olli,
Why is in discussion ?
Originally I made these factories to work best with Cucumber tests, and those have their own stashing and tearDown-mechanisms. Back then I didn't think far enough and those things have been dealt in the Cucumber framework. So all the other ObjectFactories, sans the BorrowerFactory are of the old model. I refactored Borrowerfactory to include the features from Cucumber-framework (multi-level stashing) but haven't done that for the rest of the ObjectFactories. So basically If one was to refactor this commit into something with only the BorrowerFactory and the parent ObjectFactory, this would be ok. I have tests and documentation to do for the REST API framework, so I can take a look at this after that, but the separation is a very easy task and a good exercise in getting to know the simplicity of these Factories. There are other bugs to test for the big authentication rewrite, if you feel like waiting for me to properly refactor this feature. I have built Bug 14540 to be stand-alone testable (with all dependencies), but most of these dependant bugs don't make much sense to test alone (since they do not have the necessary context to prove their usefulness. You can still safely apply this bug, since the non-refactored factories don't hinder testing the whole rewrite or interfere with Koha in any way. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13906 Zeno Tajoli <z.tajoli@cineca.it> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks|14540 | See Also| |http://bugs.koha-community. | |org/bugzilla3/show_bug.cgi? | |id=14540 Referenced Bugs: http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14540 [Bug 14540] Move member-flags.pl to PermissionsManager to better manage permissions for testing. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13906 Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #41119|0 |1 is obsolete| | --- Comment #9 from Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> --- Created attachment 41154 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=41154&action=edit Bug 13906 - TestObjectFactory(ies) for Koha objects. Enable easy Test object creation from HASHes or from preconfigured test groups. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13906 Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #41154|0 |1 is obsolete| | --- Comment #10 from Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> --- Created attachment 41251 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=41251&action=edit Bug 13906 - TestObjectFactory(ies) for Koha objects. Enable easy Test object creation/deletion from HASHes. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13906 Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |14539 Referenced Bugs: http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14539 [Bug 14539] Introduction to castToObject(), aka. make a Koha::Object from various input types -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13906 --- Comment #11 from Lari Taskula <larit@student.uef.fi> --- Created attachment 41459 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=41459&action=edit Bug 13906 - (follow-up) Add SystemPreferenceFactory (TestObjectFactory) This follow-up adds SystemPreferenceFactory into TestObject Factories. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13906 Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #41251|0 |1 is obsolete| | Attachment #41459|0 |1 is obsolete| | --- Comment #12 from Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> --- Created attachment 41531 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=41531&action=edit Bug 13906 - TestObjectFactory(ies) for Koha objects. Enable easy Test object creation/deletion from HASHes. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13906 --- Comment #13 from Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> --- Created attachment 42108 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=42108&action=edit Bug 13906 - TestObjectFactoreis squashables -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13906 Lari Taskula <larit@student.uef.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |14616 CC| |larit@student.uef.fi Referenced Bugs: http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14616 [Bug 14616] Introducing Koha::Object subclasses -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13906 --- Comment #14 from Lari Taskula <larit@student.uef.fi> --- Created attachment 42141 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=42141&action=edit Bug 13906: (follow-up) - MessageQueueFactory for adding messages to message_queue This follow-up adds MessageQueue factory for generating messages into message_queue. The default hash key is field "from_address". MessageQueueFactory sets the newly generated messages into 'pending' status via C4::Letters to await further processing from your tests. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13906 Zeno Tajoli <z.tajoli@cineca.it> changed: What |Removed |Added ---------------------------------------------------------------------------- CC|z.tajoli@cineca.it | Patch complexity|--- |Large patch -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13906 Lari Taskula <larit@student.uef.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #42141|0 |1 is obsolete| | --- Comment #15 from Lari Taskula <larit@student.uef.fi> --- Created attachment 42161 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=42161&action=edit Bug 13906: (follow-up) - MessageQueueFactory for adding messages to message_queue -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13906 Lari Taskula <larit@student.uef.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #42161|0 |1 is obsolete| | --- Comment #16 from Lari Taskula <larit@student.uef.fi> --- Created attachment 42169 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=42169&action=edit Bug 13906: (follow-up) - MessageQueueFactory for adding messages to message_queue -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13906 Lari Taskula <larit@student.uef.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #42108|0 |1 is obsolete| | --- Comment #17 from Lari Taskula <larit@student.uef.fi> --- Created attachment 42430 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=42430&action=edit Bug 13906 - TestObjectFactoreis squashables Fixed File::Fu::File version from PerlDependencies, 0.08 => 0.0.8 -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13906 Lari Taskula <larit@student.uef.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #42169|0 |1 is obsolete| | --- Comment #18 from Lari Taskula <larit@student.uef.fi> --- Created attachment 42552 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=42552&action=edit Bug 13906: (follow-up) - MessageQueueFactory for adding messages to message_queue C4::Letters has inconsistent hash key naming in some of the subroutines (EnqueueLetter vs. GetQueuedMessages). Modified the naming to match the database format so that hopefully it won't make our hair so grey with the factory at least. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13906 Lari Taskula <larit@student.uef.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #42552|0 |1 is obsolete| | --- Comment #19 from Lari Taskula <larit@student.uef.fi> --- Created attachment 42563 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=42563&action=edit Bug 13906: (follow-up) - MessageQueueFactory for adding messages to message_queue Fixes MessageQueue stash name to lower case. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13906 Lari Taskula <larit@student.uef.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #42563|0 |1 is obsolete| | --- Comment #20 from Lari Taskula <larit@student.uef.fi> --- Created attachment 42602 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=42602&action=edit Bug 13906: (follow-up) - MessageQueueFactory for adding messages to message_queue -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13906 --- Comment #21 from Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> --- Created attachment 44293 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=44293&action=edit Bug 13906 - TestObjectFactory(ies) for Koha objects. Holds test factory for v3.16 -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13906 Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |10744 Referenced Bugs: http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10744 [Bug 10744] ExpireReservesMaxPickUpDelay has minor workflow conflicts with hold(s) over report -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13906 M. Tompsett <mtompset@hotmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |15156 Referenced Bugs: http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15156 [Bug 15156] Get all Borrowers with pending/unpaid fines/accountlines -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13906 M. Tompsett <mtompset@hotmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |mtompset@hotmail.com --- Comment #22 from M. Tompsett <mtompset@hotmail.com> --- *ping* Is this moving forward? -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13906 Lari Taskula <larit@student.uef.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #44293|0 |1 is obsolete| | --- Comment #23 from Lari Taskula <larit@student.uef.fi> --- Created attachment 47244 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=47244&action=edit Bug 13906 - TestObjectFactory(ies) for Koha objects. Holds test factory for v3.16 Fixes a conflict. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13906 Lari Taskula <larit@student.uef.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |14698 Referenced Bugs: http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14698 [Bug 14698] AtomicUpdater - Keeps track of which updates have been applied to a database -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13906 --- Comment #24 from Lari Taskula <larit@student.uef.fi> --- Created attachment 47253 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=47253&action=edit Bug 13906 (follow-up) - New TestObjectFactory for creating fines into accountlines Adds FinesFactory that creates new fines into accountlines. -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org