[Bug 10333] New: UT: Labels/t_Batch.t needs to create its own data
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10333 Bug ID: 10333 Summary: UT: Labels/t_Batch.t needs to create its own data Classification: Unclassified Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: normal Priority: P5 - low Component: Test Suite Assignee: gmcharlt@gmail.com Reporter: jonathan.druart@biblibre.com t/db_dependent/Labels/t_Batch.t depends on the Jenkins database. We should create the data we want and delete them at the end. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10333 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |ASSIGNED Blocks| |10273 Assignee|gmcharlt@gmail.com |jonathan.druart@biblibre.co | |m -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10333 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10333 --- Comment #1 from Jonathan Druart <jonathan.druart@biblibre.com> --- Created attachment 18384 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=18384&action=edit Bug 10333: Labels/t_Batch.t needs to create its own data prove t/db_dependent/Labels/t_Batch.t [14:53:09] t/db_dependent/Labels/t_Batch.t .. 1/32 # Testing Batch->new() method. t/db_dependent/Labels/t_Batch.t .. 13/32 # Testing Batch->retrieve() method. t/db_dependent/Labels/t_Batch.t .. ok All tests successful. Files=1, Tests=32, 3 wallclock secs ( 0.02 usr 0.00 sys + 0.48 cusr 0.03 csys = 0.53 CPU) Result: PASS -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10333 Chris Cormack <chris@bigballofwax.co.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10333 Chris Cormack <chris@bigballofwax.co.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #18384|0 |1 is obsolete| | --- Comment #2 from Chris Cormack <chris@bigballofwax.co.nz> --- Created attachment 18399 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=18399&action=edit Bug 10333: Labels/t_Batch.t needs to create its own data prove t/db_dependent/Labels/t_Batch.t [14:53:09] t/db_dependent/Labels/t_Batch.t .. 1/32 # Testing Batch->new() method. t/db_dependent/Labels/t_Batch.t .. 13/32 # Testing Batch->retrieve() method. t/db_dependent/Labels/t_Batch.t .. ok All tests successful. Files=1, Tests=32, 3 wallclock secs ( 0.02 usr 0.00 sys + 0.48 cusr 0.03 csys = 0.53 CPU) Result: PASS Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10333 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Failed QA CC| |kyle@bywatersolutions.com --- Comment #3 from Kyle M Hall <kyle@bywatersolutions.com> --- With this patch, the tests now assume that the home and holding branch are in 952 a and b. While this is the Koha default, it's not necessarily true. I think it would be better to get the values for these fields using GetMarcFromKohaField(). -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10333 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Signed Off -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10333 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #18399|0 |1 is obsolete| | --- Comment #4 from Jonathan Druart <jonathan.druart@biblibre.com> --- Created attachment 19201 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=19201&action=edit Bug 10333: Labels/t_Batch.t needs to create its own data (In reply to Kyle M Hall from comment #3)
With this patch, the tests now assume that the home and holding branch are in 952 a and b. While this is the Koha default, it's not necessarily true.
I think it would be better to get the values for these fields using GetMarcFromKohaField().
I use a DB with sample data, but you are right, it is not necessary to add this constraint. This new patch uses C4::Biblio::GetMarcFromKohaField and executes sql queries in a transaction. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10333 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10333 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10333 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Needs Signoff --- Comment #5 from Kyle M Hall <kyle@bywatersolutions.com> --- Looks like this patch needs re-signed off. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10333 Srdjan Jankovic <srdjan@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |srdjan@catalyst.net.nz --- Comment #6 from Srdjan Jankovic <srdjan@catalyst.net.nz> --- # Testing Batch->get_attr() method. # Testing Batch->add_item() method. # Testing Batch->retrieve() method. # Failed test at t/db_dependent/Labels/t_Batch.t line 100. # Structures begin differing at: # $got = '-2' # $expected = C4::Labels::Batch=HASH(0x3aaa5b8) # Retrieved batch object FAILED to verify. # Testing Batch->remove_item() method. # Failed test at t/db_dependent/Labels/t_Batch.t line 109. # Structures begin differing at: # $got = '-2' # $expected = C4::Labels::Batch=HASH(0x3aaa5b8) # Updated batch object FAILED to verify. # Testing Batch->delete() method. # Looks like you planned 33 tests but ran 13. Do I need some setup first? -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10333 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |ASSIGNED --- Comment #7 from Jonathan Druart <jonathan.druart@biblibre.com> --- (In reply to Srdjan Jankovic from comment #6)
Do I need some setup first?
No, this should be done by this unit tests file. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10333 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10333 --- Comment #8 from Jonathan Druart <jonathan.druart@biblibre.com> --- Created attachment 20276 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=20276&action=edit Bug 10333: remove_item should be called just one time If there is no remaining items, the retrieve routine returns -2. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10333 --- Comment #9 from Srdjan Jankovic <srdjan@catalyst.net.nz> --- # Testing Batch->new() method. # Testing Batch->get_attr() method. # Testing Batch->add_item() method. Use of uninitialized value $encoding in string eq at C4/Biblio.pm line 3281. Use of uninitialized value $encoding in pattern match (m//) at C4/Biblio.pm line 3301. # Testing Batch->retrieve() method. # Failed test at t/db_dependent/Labels/t_Batch.t line 100. # Structures begin differing at: # $got = '-2' # $expected = C4::Labels::Batch=HASH(0x2df33c0) # Retrieved batch object FAILED to verify. # Testing Batch->remove_item() method. # Failed test at t/db_dependent/Labels/t_Batch.t line 108. # Structures begin differing at: # $got = '-2' # $expected = C4::Labels::Batch=HASH(0x2df33c0) # Updated batch object FAILED to verify. # Testing Batch->delete() method. # Looks like you planned 24 tests but ran 14. # Looks like you failed 2 tests of 14 run. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10333 --- Comment #10 from Jonathan Druart <jonathan.druart@biblibre.com> --- (In reply to Srdjan Jankovic from comment #9)
Use of uninitialized value $encoding in string eq at C4/Biblio.pm line 3281. Use of uninitialized value $encoding in pattern match (m//) at C4/Biblio.pm line 3301.
I have no idea where is the problem. But there 2 lines intrigues me. $encoding is C4::Context->preference("marcflavour"). Don't you have the marcflavour syspref in your DB? -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10333 --- Comment #11 from Srdjan Jankovic <srdjan@catalyst.net.nz> --- Yes, I was doing something else and removed the syspref erroneously. When I put it back there are no warnings. But the test failures stayed. Do you need any more details eg table dumps? -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10333 --- Comment #12 from Jonathan Druart <jonathan.druart@biblibre.com> --- (In reply to Srdjan Jankovic from comment #11)
Yes, I was doing something else and removed the syspref erroneously. When I put it back there are no warnings. But the test failures stayed. Do you need any more details eg table dumps?
I read the code but I have no idea why they don't pass. First step, the batch is created and the batch_id is backed-up into the $batch_id var. Items are added to the batch and the retrieve method returns -2 if the batch does not contain items. Maybe could you warn the $batch_id var (l. 56)? Should be > 1. To check if items have been added could be interesting too (SELECT * FROM creator_batches WHERE batch_id = $batch_id). -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10333 Srdjan Jankovic <srdjan@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10333 Srdjan Jankovic <srdjan@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #19201|0 |1 is obsolete| | Attachment #20276|0 |1 is obsolete| | --- Comment #13 from Srdjan Jankovic <srdjan@catalyst.net.nz> --- Created attachment 20454 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=20454&action=edit Bug 10333: Labels/t_Batch.t needs to create its own data prove t/db_dependent/Labels/t_Batch.t db_dependent/Labels/t_Batch.t .. 1/33 # Testing Batch->new() method. db_dependent/Labels/t_Batch.t .. ok All tests successful. Files=1, Tests=33, 1 wallclock secs ( 0.03 usr 0.00 sys + 0.34 cusr 0.00 csys = 0.37 CPU) Result: PASS Signed-off-by: Srdjan <srdjan@catalyst.net.nz> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10333 --- Comment #14 from Srdjan Jankovic <srdjan@catalyst.net.nz> --- C4::Items::AddItemBatchFromMarc was failing (no records returned), I had no CPL branches. You may wish to add some check there, but om if you don't (it's that testing data bug request that is still being discussed). -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10333 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA Patch complexity|--- |Small patch -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10333 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #20454|0 |1 is obsolete| | --- Comment #15 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Created attachment 20593 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=20593&action=edit [PASSED QA] Bug 10333: Labels/t_Batch.t needs to create its own data prove t/db_dependent/Labels/t_Batch.t db_dependent/Labels/t_Batch.t .. 1/33 # Testing Batch->new() method. db_dependent/Labels/t_Batch.t .. ok All tests successful. Files=1, Tests=33, 1 wallclock secs ( 0.03 usr 0.00 sys + 0.34 cusr 0.00 csys = 0.37 CPU) Result: PASS Signed-off-by: Srdjan <srdjan@catalyst.net.nz> Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10333 Galen Charlton <gmcharlt@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to Master CC| |gmcharlt@gmail.com --- Comment #16 from Galen Charlton <gmcharlt@gmail.com> --- Pushed to master. Thanks, Jonathan! -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10333 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to Master |Pushed to Stable CC| |tomascohen@gmail.com --- Comment #17 from Tomás Cohen Arazi <tomascohen@gmail.com> --- This patch has been pushed to 3.12.x, will be in 3.12.6. Thanks Jonathan! -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org