Bugzilla – Attachment 131314 Details for
Bug 30203
Prevent data loss when running Circulation.t without prove
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 30203: Circulation.t: prevent locking by setting envvar
Bug-30203-Circulationt-prevent-locking-by-setting-.patch (text/plain), 1.44 KB, created by
Marcel de Rooy
on 2022-03-03 10:35:29 UTC
(
hide
)
Description:
Bug 30203: Circulation.t: prevent locking by setting envvar
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2022-03-03 10:35:29 UTC
Size:
1.44 KB
patch
obsolete
>From 686ffc919c2eaa325eccf5b1da085f90fa0fbf66 Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Thu, 3 Mar 2022 10:27:20 +0000 >Subject: [PATCH] Bug 30203: Circulation.t: prevent locking by setting envvar >Content-Type: text/plain; charset=utf-8 > >Running this test without prove is disastrous. The LOCK in >the called SendCirculationAlert will ruin your data. >But no longer when you apply this patch. > >Test plan: >Run prove Circulation.t >Inspect your data (e.g. borrowers table). >Run perl Circulation.t >Inspect your data (e.g. borrowers table) again. > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >--- > t/db_dependent/Circulation.t | 5 +++++ > 1 file changed, 5 insertions(+) > >diff --git a/t/db_dependent/Circulation.t b/t/db_dependent/Circulation.t >index 3b0b09b83f..249e8aee1c 100755 >--- a/t/db_dependent/Circulation.t >+++ b/t/db_dependent/Circulation.t >@@ -4904,6 +4904,11 @@ subtest "updateWrongTransfer tests" => sub { > subtest "SendCirculationAlert" => sub { > plan tests => 2; > >+ # When you would unsuspectingly call this unit test (with perl, not prove), you will be bitten by LOCK. >+ # LOCK will commit changes and ruin your data >+ # In order to prevent that, we will add KOHA_TESTING to $ENV; see further Circulation.pm >+ $ENV{KOHA_TESTING} = 1; >+ > # Setup branch, borrowr, and notice > my $library = $builder->build_object({ class => 'Koha::Libraries' }); > set_userenv( $library->unblessed); >-- >2.20.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 30203
:
131314
|
131315