Bugzilla – Attachment 139849 Details for
Bug 31473
Test about bad OpacHiddenItems conf fragile
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 31473: Fix fragile test about bad OpacHiddenItems conf
Bug-31473-Fix-fragile-test-about-bad-OpacHiddenIte.patch (text/plain), 1.75 KB, created by
Tomás Cohen Arazi (tcohen)
on 2022-08-26 19:53:51 UTC
(
hide
)
Description:
Bug 31473: Fix fragile test about bad OpacHiddenItems conf
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2022-08-26 19:53:51 UTC
Size:
1.75 KB
patch
obsolete
>From 3a5fb22ad88790673d6d8fbc483f6e219f25f33d Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Fri, 26 Aug 2022 16:45:10 -0300 >Subject: [PATCH] Bug 31473: Fix fragile test about bad OpacHiddenItems conf > >There's been a behavior change in recent MariaDB that made some cases >deal with truncated data in DOUBLE context instead of DECIMAL. > >Probably this: >https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-27380 > >This made the affected test fail consistently on those versions. > >This trick for checking OpacHiddenItems is correct (as introduced on bug >28125 doesn't really make use of the warning, just prints it in >about.pl) so one option was to just check for a warning. > >I decided to keep the test, but add the optional DECIMAL|DOUBLE check on >the qr. This way other eventual changes will make it fail and serve as a >warning in case something more relevant changes. > >To test: >1. Apply this patch >2. Run: > $ kshell > k$ t/db_dependent/Koha/Items.t >=> SUCCESS: Tests pass! >3. Sign off :-D > >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> >--- > t/db_dependent/Koha/Items.t | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > >diff --git a/t/db_dependent/Koha/Items.t b/t/db_dependent/Koha/Items.t >index 980bd3d983..76c9e33a27 100755 >--- a/t/db_dependent/Koha/Items.t >+++ b/t/db_dependent/Koha/Items.t >@@ -1751,7 +1751,7 @@ subtest 'filter_by_visible_in_opac() tests' => sub { > $rules = { itemlost => ['AB'] }; > my $c = Koha::Items->filter_by_visible_in_opac->count; > my @warnings = C4::Context->dbh->selectrow_array('SHOW WARNINGS'); >- is( $warnings[2], q{Truncated incorrect DOUBLE value: 'AB'}); >+ like( $warnings[2], qr/Truncated incorrect (DOUBLE|DECIMAL) value: 'AB'/); > > $schema->storage->txn_rollback; > }; >-- >2.37.2
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 31473
: 139849