Bug 34414

Summary: Remove DBD::Mock
Product: Koha Reporter: Marcel de Rooy <m.de.rooy>
Component: Architecture, internals, and plumbingAssignee: Marcel de Rooy <m.de.rooy>
Status: RESOLVED FIXED QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low CC: fridolin.somers, mtj
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Trivial patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
23.11.00
Bug Depends on: 33940    
Bug Blocks:    
Attachments: Bug 34414: Remove DBD::Mock
Bug 34414: Remove DBD::Mock

Description Marcel de Rooy 2023-07-26 06:53:53 UTC
Bug 33940 will remove t/Members/cardnumber.t that APPEARS to use a feature of DBD::Mock, i.e. filling $dbh->{mock_add_resultset}.
But since the module is not loaded there (since ages), the whole thing is not even working!

Simple illustration.
Suppose you have borrower 50.
Run update cardnumber='123456789' where borrowernumber=50;
Now run t/Members/cardnumber.t

not ok 3 - 123456789 is shorter than 10
#   Failed test '123456789 is shorter than 10'
#   at t/Members/cardnumber.t line 36.
#          got: '1'
#     expected: '2'

What happened? Instead of using the mocked empty set, checkcardnumber finds your 123456789 cardnumber in the database. Deception !
Comment 1 Marcel de Rooy 2023-07-26 06:54:56 UTC
(In reply to Marcel de Rooy from comment #0)
> Run update cardnumber='123456789' where borrowernumber=50;

update borrowers set cardnumber='123456789' where borrowernumber=50;
Comment 2 Marcel de Rooy 2023-07-26 07:04:21 UTC
Created attachment 153896 [details] [review]
Bug 34414: Remove DBD::Mock

We never actually used it. See BZ report.

Test plan:
Run git grep DBD::Mock. Only finding old release notes.
Run git grep mock_add_resultset. Nothing.
Bonus: Find a few other DBD::Mock properties/attributes.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 3 Marcel de Rooy 2023-07-26 07:06:23 UTC
QA: NOTE the dependency
Comment 4 Jonathan Druart 2023-07-26 08:01:39 UTC
Created attachment 153897 [details] [review]
Bug 34414: Remove DBD::Mock

We never actually used it. See BZ report.

Test plan:
Run git grep DBD::Mock. Only finding old release notes.
Run git grep mock_add_resultset. Nothing.
Bonus: Find a few other DBD::Mock properties/attributes.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 5 Marcel de Rooy 2023-09-02 13:47:32 UTC
Taking the liberty to move this to PQA.
Trivial. Signed off by QA team member.
Comment 6 Tomás Cohen Arazi 2023-09-15 14:58:42 UTC
Pushed to master for 23.11.

Nice work everyone, thanks!
Comment 7 Fridolin Somers 2023-09-18 07:34:06 UTC
Depends on Bug 33940 not in 23.05.x