Bug 35042 - Members.t: should not set datelastseen to NULL everywhere
Summary: Members.t: should not set datelastseen to NULL everywhere
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Test Suite (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal
Assignee: Marcel de Rooy
QA Contact: Katrin Fischer
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-10-12 09:32 UTC by Marcel de Rooy
Modified: 2024-07-04 20:40 UTC (History)
1 user (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,23.05.05,22.11.12
Circulation function:


Attachments
Bug 35042: Remove set datelastseen to null on table in Members.t (2.75 KB, patch)
2023-10-12 11:57 UTC, Marcel de Rooy
Details | Diff | Splinter Review
Bug 35042: Remove set datelastseen to null on table in Members.t (2.76 KB, patch)
2023-10-14 15:33 UTC, Katrin Fischer
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-10-12 09:32:22 UTC
It can be tempting to remove all records from a table or just set one column to NULL in a whole table to get a test working quickly.

But we should better avoid that, or replace it by something less drastic (if reasonably possible).

An example from Members.t:

$dbh->do(q|UPDATE borrowers SET lastseen=NULL|);

Surely you should not run such tests on a production db. But when someone forgets a rollback here or there, you might have some troubled data on your test system, and often needless.
Note that I still often see test branches or item types appear in my test data after spending some time on a test db with master (running some tests).
Comment 1 Marcel de Rooy 2023-10-12 11:57:36 UTC
Created attachment 156954 [details] [review]
Bug 35042: Remove set datelastseen to null on table in Members.t

Non-trivial was adding the category_type <> S.

Test plan:
Run t/db_dependent/Members.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 2 Marcel de Rooy 2023-10-12 11:58:32 UTC
Just run the test! Switching to SO
Comment 3 Katrin Fischer 2023-10-14 15:33:22 UTC
Created attachment 157153 [details] [review]
Bug 35042: Remove set datelastseen to null on table in Members.t

Non-trivial was adding the category_type <> S.

Test plan:
Run t/db_dependent/Members.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 4 Tomás Cohen Arazi (tcohen) 2023-10-18 13:23:41 UTC
Pushed to master for 23.11.

Nice work everyone, thanks!
Comment 5 Fridolin Somers 2023-10-25 07:14:53 UTC
Pushed to 23.05.x for 23.05.05
Comment 6 Matt Blenkinsop 2023-11-13 13:46:15 UTC
Nice work everyone!

Pushed to oldstable for 22.11.x