Bugzilla – Attachment 186254 Details for
Bug 22632
Add logging of merged patrons
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 22632: Prevent tests to fail randomly
Bug-22632-Prevent-tests-to-fail-randomly.patch (text/plain), 3.87 KB, created by
Jonathan Druart
on 2025-09-08 08:23:10 UTC
(
hide
)
Description:
Bug 22632: Prevent tests to fail randomly
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2025-09-08 08:23:10 UTC
Size:
3.87 KB
patch
obsolete
>From e58bb168ff9d89a364e1a044fd05dc17fcfee053 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Mon, 8 Sep 2025 10:21:55 +0200 >Subject: [PATCH] Bug 22632: Prevent tests to fail randomly > >Jenkins was failing on Koha_Master/3350 > >With this patch we won't rely on the order (timestamp are identical and >may not be sorted as expected) > >23:56:28 koha-1 | # Failed test 'GetLogs returns results in the log viewer for the merge of 526' >23:56:28 koha-1 | # at t/db_dependent/Koha/Patron/Log.t line 67. >23:56:28 koha-1 | # got: 'G7X8jre jVr_oz8M (eQXWiW9b4jX16424uC3Chn) has been merged into Mwqx7a zkSkFX7 (y_L7flupzFShb8JWYVCwYGSuv)' >23:56:28 koha-1 | # expected: 'exgnQtw lLmxQL9eWY (nHc_VZdFHIXr90p6WrIijDPgFrz8JM38) has been merged into Mwqx7a zkSkFX7 (y_L7flupzFShb8JWYVCwYGSuv)' >23:56:28 koha-1 | >23:56:28 koha-1 | # Failed test 'GetLogs returns results in the log viewer for the merge of 527' >23:56:28 koha-1 | # at t/db_dependent/Koha/Patron/Log.t line 82. >23:56:28 koha-1 | # got: 'exgnQtw lLmxQL9eWY (nHc_VZdFHIXr90p6WrIijDPgFrz8JM38) has been merged into Mwqx7a zkSkFX7 (y_L7flupzFShb8JWYVCwYGSuv)' >23:56:28 koha-1 | # expected: 'G7X8jre jVr_oz8M (eQXWiW9b4jX16424uC3Chn) has been merged into Mwqx7a zkSkFX7 (y_L7flupzFShb8JWYVCwYGSuv)' >23:56:28 koha-1 | # Looks like you failed 2 tests of 4. >23:56:28 koha-1 | >23:56:28 koha-1 | # Failed test 'Test Koha::Patrons::merge' >23:56:28 koha-1 | # at t/db_dependent/Koha/Patron/Log.t line 113. >--- > t/db_dependent/Koha/Patron/Log.t | 23 ++++++----------------- > 1 file changed, 6 insertions(+), 17 deletions(-) > >diff --git a/t/db_dependent/Koha/Patron/Log.t b/t/db_dependent/Koha/Patron/Log.t >index 8734497ce61..4e0fd28d697 100755 >--- a/t/db_dependent/Koha/Patron/Log.t >+++ b/t/db_dependent/Koha/Patron/Log.t >@@ -27,7 +27,7 @@ $schema->storage->txn_begin; > > subtest 'Test Koha::Patrons::merge' => sub { > >- plan tests => 4; >+ plan tests => 3; > my $builder = t::lib::TestBuilder->new; > > my $keeper = $builder->build_object( { class => 'Koha::Patrons' } ); >@@ -49,7 +49,7 @@ subtest 'Test Koha::Patrons::merge' => sub { > object => $keeper->id > }, > { order_by => { -desc => "timestamp" } } >- )->unblessed; >+ ); > > my $info_borrower1 = > $borrower1->{firstname} . " " >@@ -59,10 +59,9 @@ subtest 'Test Koha::Patrons::merge' => sub { > . $keeper->firstname . " " > . $keeper->surname . " (" > . $keeper->cardnumber . ")"; >- my $info_log = $log->[0]{info}; > > is( >- $info_log, $info_borrower1, >+ $log->search( { info => $info_borrower1 } )->count, 1, > "GetLogs returns results in the log viewer for the merge of " . $borrower1->{borrowernumber} > ); > >@@ -74,10 +73,9 @@ subtest 'Test Koha::Patrons::merge' => sub { > . $keeper->firstname . " " > . $keeper->surname . " (" > . $keeper->cardnumber . ")"; >- $info_log = $log->[1]{info}; > > is( >- $info_log, $info_borrower2, >+ $log->search( { info => $info_borrower2 } )->count, 1, > "GetLogs returns results in the log viewer for the merge of " . $borrower2->{borrowernumber} > ); > >@@ -95,20 +93,11 @@ subtest 'Test Koha::Patrons::merge' => sub { > object => $keeper->id > }, > { order_by => { -desc => "timestamp" } } >- )->unblessed; >- >- $info_log = $log->[0]{info}; >- >- is( >- $info_log, undef, >- "GetLogs didn't returns results in the log viewer for the merge of " . $borrower3->{borrowernumber} > ); > >- $info_log = $log->[1]{info}; >- > is( >- $info_log, undef, >- "GetLogs didn't returns results in the log viewer for the merge of " . $borrower4->{borrowernumber} >+ $log->count, 0, >+ "GetLogs didn't log anything" > ); > }; > >-- >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 22632
:
87778
|
87920
|
87921
|
87922
|
87923
|
87926
|
87995
|
87996
|
87997
|
87998
|
87999
|
88043
|
88044
|
88045
|
88046
|
89728
|
89729
|
89730
|
89731
|
157260
|
157261
|
157262
|
157263
|
157264
|
157265
|
157266
|
157267
|
157268
|
157269
|
157270
|
157271
|
157278
|
157281
|
157286
|
159553
|
159554
|
159555
|
159556
|
159557
|
159558
|
184493
|
184494
|
184495
|
184496
|
184497
|
184503
|
184504
|
184505
|
184506
|
184507
|
185058
|
185059
|
185060
|
185061
|
185062
|
185063
| 186254