[Bug 15391] New: Some tests in HoldsQueue.t should not pass
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15391 Bug ID: 15391 Summary: Some tests in HoldsQueue.t should not pass Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: normal Priority: P5 - low Component: Architecture, internals, and plumbing Assignee: gmcharlt@gmail.com Reporter: jonathan.druart@bugs.koha-community.org QA Contact: testopia@bugs.koha-community.org We are checking if we have at least 1 item type not for loan: 63 my @item_types = C4::ItemType->all; 64 my $itemtype = grep { $_->{notforloan} == 1 } @item_types 65 or BAIL_OUT("No adequate itemtype"); Then we use the $itemtype variable (which contains the number of item types not for loan): 92 $dbh->do("INSERT INTO biblioitems (biblionumber, marcxml, itemtype) 93 VALUES ($biblionumber, '', '$itemtype')"); There is obviously something wrong here. The code should be 64 my @not_for_loan = grep { $_->{notforloan} == 1 } @item_types 65 or BAIL_OUT("No adequate itemtype"); 66 my $itemtype = $not_for_loan[0]->{itemtype}; But then some tests don't pass: # Looks like you failed 8 tests of 17 run. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15391 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |kyle@bywatersolutions.com --- Comment #1 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Kyle, could you have a look please? I don't manage to get what is wrong here. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15391 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |http://bugs.koha-community. | |org/bugzilla3/show_bug.cgi? | |id=14828 -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15391 --- Comment #2 from Kyle M Hall <kyle@bywatersolutions.com> --- FYI, this is still on my radar, I just haven't gotten to it yet. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15391 Marc Véron <veron@veron.ch> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |veron@veron.ch -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15391 --- Comment #3 from Kyle M Hall <kyle@bywatersolutions.com> --- The "itemtype" from line 64 is being inserted into a biblioitems row at line , which does not have a foreign key to itemtypes, so it succeeds. The itemtype is re-used at line 98 for an item. It appears the test actually requires the item to be *for* loan, rather than not for loan. Since the itemtype doesn't really exists, is seems to fail as a for loan itemtype, even though it seems like we should get an execution error instead. Then, at line 181 the itemtype is replace with an arbitrary itemtype selected from the database, which is probably just a lucky grab since the default data would give a for loan itemtype first. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15391 --- Comment #4 from Kyle M Hall <kyle@bywatersolutions.com> --- Also, I kind of expected this tests to fail when I set item level itypes to biblio, but it still continued to succeed. It seems that the selection of a not for loan itemtype is just cruft at this point. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15391 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15391 --- Comment #5 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 46911 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=46911&action=edit Bug 15391: Fix HoldsQueue.t tests Prior to this patch, in HoldsQueue.t: 63 my @item_types = C4::ItemType->all; 64 my $itemtype = grep { $_->{notforloan} == 1 } @item_types 65 or BAIL_OUT("No adequate itemtype"); Then we use the $itemtype variable (which contains the number of item types not for loan): 92 $dbh->do("INSERT INTO biblioitems (biblionumber, marcxml, itemtype) 93 VALUES ($biblionumber, '', '$itemtype')"); There is obviously something wrong here. The code should be 64 my @not_for_loan = grep { $_->{notforloan} == 1 } @item_types 65 or BAIL_OUT("No adequate itemtype"); 66 my $itemtype = $not_for_loan[0]->{itemtype}; But then some tests don't pass: Actually the problem comes from: commit bfbc646fdd9ca4b90a0bc2751d0faa95d9e93ba1 Bug 10336: HoldsQueue.t needs to create its own data -my $itemtype = $dbh->selectrow_array("SELECT min(itemtype) FROM itemtypes WHERE notforloan = 0") +my @item_types = C4::ItemType->all; +my $itemtype = grep { $_->{notforloan} == 1 } @item_types The line should have been: my $itemtype = grep { $_->{notforloan} == 0 } @item_types Test plan: Confirm that the tests still pass after this patch applied. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15391 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|gmcharlt@gmail.com |jonathan.druart@bugs.koha-c | |ommunity.org -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15391 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|Some tests in HoldsQueue.t |HoldsQueue.t does not |should not pass |handle for loan itemtypes | |correctly -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15391 Aleisha Amohia <aleishaamohia@hotmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |aleishaamohia@hotmail.com --- Comment #6 from Aleisha Amohia <aleishaamohia@hotmail.com> --- t/db_dependent/HoldsQueue.t .. 3/23 # Failed test 'Bug 15062 - Holds queue with Transport Cost Matrix will transfer item even if transfers disabled' # at t/db_dependent/HoldsQueue.t line 413. # got: '1' # expected: '0' # Looks like you failed 1 test of 23. t/db_dependent/HoldsQueue.t .. Dubious, test returned 1 (wstat 256, 0x100) Failed 1/23 subtests Test Summary Report ------------------- t/db_dependent/HoldsQueue.t (Wstat: 256 Tests: 23 Failed: 1) Failed test: 23 Non-zero exit status: 1 Files=1, Tests=23, 1 wallclock secs ( 0.02 usr 0.01 sys + 1.39 cusr 0.08 csys = 1.50 CPU) Result: FAIL -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15391 --- Comment #7 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Aleisha, could you confirm the tests pass before the patch? -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15391 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=15391 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #46911|0 |1 is obsolete| | --- Comment #8 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 46990 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=46990&action=edit Bug 15391: Fix HoldsQueue.t tests Prior to this patch, in HoldsQueue.t: 63 my @item_types = C4::ItemType->all; 64 my $itemtype = grep { $_->{notforloan} == 1 } @item_types 65 or BAIL_OUT("No adequate itemtype"); Then we use the $itemtype variable (which contains the number of item types not for loan): 92 $dbh->do("INSERT INTO biblioitems (biblionumber, marcxml, itemtype) 93 VALUES ($biblionumber, '', '$itemtype')"); There is obviously something wrong here. The code should be 64 my @not_for_loan = grep { $_->{notforloan} == 1 } @item_types 65 or BAIL_OUT("No adequate itemtype"); 66 my $itemtype = $not_for_loan[0]->{itemtype}; But then some tests don't pass: Actually the problem comes from: commit bfbc646fdd9ca4b90a0bc2751d0faa95d9e93ba1 Bug 10336: HoldsQueue.t needs to create its own data -my $itemtype = $dbh->selectrow_array("SELECT min(itemtype) FROM itemtypes WHERE notforloan = 0") +my @item_types = C4::ItemType->all; +my $itemtype = grep { $_->{notforloan} == 1 } @item_types The line should have been: my $itemtype = grep { $_->{notforloan} == 0 } @item_types Test plan: Confirm that the tests still pass after this patch applied. Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> All tests pass pre and post patch -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15391 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact|testopia@bugs.koha-communit |gmcharlt@gmail.com |y.org | CC| |katrin.fischer@bsz-bw.de Component|Architecture, internals, |Test Suite |and plumbing | -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15391 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Patch complexity|--- |Small patch Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15391 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #46990|0 |1 is obsolete| | --- Comment #9 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Created attachment 47061 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=47061&action=edit [PASSED QA] Bug 15391: Fix HoldsQueue.t tests Prior to this patch, in HoldsQueue.t: 63 my @item_types = C4::ItemType->all; 64 my $itemtype = grep { $_->{notforloan} == 1 } @item_types 65 or BAIL_OUT("No adequate itemtype"); Then we use the $itemtype variable (which contains the number of item types not for loan): 92 $dbh->do("INSERT INTO biblioitems (biblionumber, marcxml, itemtype) 93 VALUES ($biblionumber, '', '$itemtype')"); There is obviously something wrong here. The code should be 64 my @not_for_loan = grep { $_->{notforloan} == 1 } @item_types 65 or BAIL_OUT("No adequate itemtype"); 66 my $itemtype = $not_for_loan[0]->{itemtype}; But then some tests don't pass: Actually the problem comes from: commit bfbc646fdd9ca4b90a0bc2751d0faa95d9e93ba1 Bug 10336: HoldsQueue.t needs to create its own data -my $itemtype = $dbh->selectrow_array("SELECT min(itemtype) FROM itemtypes WHERE notforloan = 0") +my @item_types = C4::ItemType->all; +my $itemtype = grep { $_->{notforloan} == 1 } @item_types The line should have been: my $itemtype = grep { $_->{notforloan} == 0 } @item_types Test plan: Confirm that the tests still pass after this patch applied. Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> All tests pass pre and post patch 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=15391 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |12803 Referenced Bugs: http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12803 [Bug 12803] Add ability to skip closed libraries when generating the holds queue -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org