Bugzilla – Attachment 147396 Details for
Bug 33054
Koha/Acquisition/Order.t is failing randomly
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 33054: Fix unit tests
Bug-33054-Fix-unit-tests.patch (text/plain), 1.58 KB, created by
Tomás Cohen Arazi
on 2023-02-24 19:32:57 UTC
(
hide
)
Description:
Bug 33054: Fix unit tests
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi
Created:
2023-02-24 19:32:57 UTC
Size:
1.58 KB
patch
obsolete
>From b743b4ae9a306b35a22a53a7776904e61ae82401 Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Fri, 24 Feb 2023 14:43:18 -0300 >Subject: [PATCH] Bug 33054: Fix unit tests > >This patch fixes the tests by making sure: >- The branch in userenv matches the home/holding branch so there are no > circ rules getting in the middle >- Gives the user superlibrarian permissions for the same reasons above. > >To test: >1. Run: > $ ktd --shell > k$ for i in $(seq 1 20 ); do prove t/db_dependent/Koha/Acquisition/Order.t ; done >=> FAIL: Notice it fails quite often. You can ctrl+c to interrupt once >it has failed at least once. >2. Apply this patch >3. Repeat 1 >=> SUCCESS: it doesn't fail a single time >4. Sign off :-D > >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> >--- > t/db_dependent/Koha/Acquisition/Order.t | 7 ++++++- > 1 file changed, 6 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/Koha/Acquisition/Order.t b/t/db_dependent/Koha/Acquisition/Order.t >index bc5aa7ec325..4d96e3b7d93 100755 >--- a/t/db_dependent/Koha/Acquisition/Order.t >+++ b/t/db_dependent/Koha/Acquisition/Order.t >@@ -654,7 +654,12 @@ subtest 'cancel() tests' => sub { > ); > $order->add_item( $item->id ); > >- my $patron = $builder->build_object({ class => 'Koha::Patrons' }); >+ my $patron = $builder->build_object( >+ { >+ class => 'Koha::Patrons', >+ value => { branchcode => $item->homebranch, flags => 1 } >+ } >+ ); > t::lib::Mocks::mock_userenv({ patron => $patron }); > > # Add a checkout so deleting the item fails because od 'book_on_loan' >-- >2.34.1
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 33054
:
147234
| 147396