Bugzilla – Attachment 77837 Details for
Bug 21230
Reserves.t is failing randomly
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 21230: Prevent Reserves.t to fail randomly
Bug-21230-Prevent-Reservest-to-fail-randomly.patch (text/plain), 1.95 KB, created by
Jonathan Druart
on 2018-08-15 15:25:00 UTC
(
hide
)
Description:
Bug 21230: Prevent Reserves.t to fail randomly
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2018-08-15 15:25:00 UTC
Size:
1.95 KB
patch
obsolete
>From 94f23bfa56fdc18d105de7ef33f86305cc39c31e Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Wed, 15 Aug 2018 12:21:38 -0300 >Subject: [PATCH] Bug 21230: Prevent Reserves.t to fail randomly > >The following test can fail if the hold has been generated with found => 'W': > # Failed test 'No tests run for subtest "_koha_notify_reserve() tests"' > # at t/db_dependent/Reserves.t line 675. >Can't call method "to_address" on an undefined value at >t/db_dependent/Reserves.t line 661. > # Looks like your test exited with 255 just after 56. > >We should call AddReserve instead. > >Test plan: >0. Do not apply this patch >1. Do the following change: > my $hold = $builder->build({ > source => 'Reserve', > value => { > borrowernumber=>$hold_borrower, > found => 'W', # This line is added, do not forget the comma above > } > }); >2. Prove it makes the test fail >3. stash the changes and apply this patch >4. Make sure the tests pass >--- > t/db_dependent/Reserves.t | 11 ++++------- > 1 file changed, 4 insertions(+), 7 deletions(-) > >diff --git a/t/db_dependent/Reserves.t b/t/db_dependent/Reserves.t >index a458e8daa8..406e45036e 100755 >--- a/t/db_dependent/Reserves.t >+++ b/t/db_dependent/Reserves.t >@@ -647,14 +647,11 @@ subtest '_koha_notify_reserve() tests' => sub { > } > })->{borrowernumber}; > >- my $hold = $builder->build({ >- source => 'Reserve', >- value => { >- borrowernumber=>$hold_borrower >- } >- }); >+ C4::Reserves::AddReserve( >+ $item->{homebranch}, $hold_borrower, >+ $item->{biblionumber} ); > >- ModReserveAffect($hold->{itemnumber}, $hold->{borrowernumber}, 0); >+ ModReserveAffect($item->{itemnumber}, $hold_borrower, 0); > my $sms_message_address = $schema->resultset('MessageQueue')->search({ > letter_code => 'HOLD', > message_transport_type => 'sms', >-- >2.11.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 21230
:
77837
|
77901
|
77926