Bug 34414 - Remove DBD::Mock
Summary: Remove DBD::Mock
Status: RESOLVED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Architecture, internals, and plumbing (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement
Assignee: Marcel de Rooy
QA Contact: Testopia
URL:
Keywords:
Depends on: 33940
Blocks:
  Show dependency treegraph
 
Reported: 2023-07-26 06:53 UTC by Marcel de Rooy
Modified: 2023-12-28 20:47 UTC (History)
2 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
23.11.00
Circulation function:


Attachments
Bug 34414: Remove DBD::Mock (975 bytes, patch)
2023-07-26 07:04 UTC, Marcel de Rooy
Details | Diff | Splinter Review
Bug 34414: Remove DBD::Mock (1011 bytes, patch)
2023-07-26 08:01 UTC, Jonathan Druart
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
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 (tcohen) 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