Bug 35548

Summary: Move KitchenSink test on its own and control table creation
Product: Koha Reporter: Marcel de Rooy <m.de.rooy>
Component: Test SuiteAssignee: Marcel de Rooy <m.de.rooy>
Status: RESOLVED FIXED QA Contact: Kyle M Hall <kyle>
Severity: enhancement    
Priority: P5 - low CC: caroline.cyr-la-rose, fridolin.somers, jonathan.druart, kyle, martin.renvoize, tomascohen
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:
24.05.00
Circulation function:
Bug Depends on: 35507, 35536    
Bug Blocks:    
Attachments: Bug 35548: Test KitchenSink plugin
Bug 35548: Test KitchenSink plugin
Bug 35548: Test KitchenSink plugin
Bug 35548: (follow-up) Fix mock statement for D10

Description Marcel de Rooy 2023-12-12 15:41:40 UTC
See bug 35507.
Since KitchenSink contains CREATE TABLE, it commits cruft into db.
Lets control that a bit more.
Comment 1 Marcel de Rooy 2023-12-20 12:46:28 UTC
Created attachment 160115 [details] [review]
Bug 35548: Test KitchenSink plugin

Removed from Plugins.t on bug 35507.
Restoring it here on its own.
Simplified a bit.

NOTE: The CREATE IF NOT EXISTS seems to commit even when the
table already exists. Therefore mocking install too.

Test plan:
Check number of records in plugin_data/methods.
Run t/db_dependent/Koha/Plugins/KitchenSink.t
Check again number of records in plugin_data/methods. Same?

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 2 Martin Renvoize 2024-01-11 09:55:12 UTC
Created attachment 160826 [details] [review]
Bug 35548: Test KitchenSink plugin

Removed from Plugins.t on bug 35507.
Restoring it here on its own.
Simplified a bit.

NOTE: The CREATE IF NOT EXISTS seems to commit even when the
table already exists. Therefore mocking install too.

Test plan:
Check number of records in plugin_data/methods.
Run t/db_dependent/Koha/Plugins/KitchenSink.t
Check again number of records in plugin_data/methods. Same?

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 3 Kyle M Hall 2024-01-12 17:05:49 UTC
Created attachment 160990 [details] [review]
Bug 35548: Test KitchenSink plugin

Removed from Plugins.t on bug 35507.
Restoring it here on its own.
Simplified a bit.

NOTE: The CREATE IF NOT EXISTS seems to commit even when the
table already exists. Therefore mocking install too.

Test plan:
Check number of records in plugin_data/methods.
Run t/db_dependent/Koha/Plugins/KitchenSink.t
Check again number of records in plugin_data/methods. Same?

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 4 Katrin Fischer 2024-03-22 11:28:18 UTC
Pushed for 24.05!

Well done everyone, thank you!
Comment 5 Jonathan Druart 2024-03-22 15:29:07 UTC
Test is failing on D10

15:36:16 koha_1       | #   Failed test 'No tests run for subtest "Fun with KitchenSink, Handler->delete"'
15:36:16 koha_1       | #   at t/db_dependent/Koha/Plugins/KitchenSink.t line 72.
15:36:16 koha_1       | Can't locate object method "mock" via package "0" (perhaps you forgot to load "0"?) at t/db_dependent/Koha/Plugins/KitchenSink.t line 56.


See
  commit d130a6c66b6cc6fb3221c0ea7e26f2d0825f4f72
  Bug 35962: (bug 35843 follow-up 2) Fix BackgroundJob.t on D10
for a solution to the same failure.
Comment 6 Marcel de Rooy 2024-03-25 08:23:22 UTC
Created attachment 163765 [details] [review]
Bug 35548: (follow-up) Fix mock statement for D10

Test plan: Run t/db_dependent/Koha/Plugins/KitchenSink.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 7 Katrin Fischer 2024-03-25 09:01:35 UTC
Follow-up pushed to master.
Comment 8 Fridolin Somers 2024-05-22 14:18:22 UTC
Not backported to 23.11.x
Comment 9 Caroline Cyr La Rose 2024-07-04 18:36:37 UTC
Test suite changes don't induce changes to the manual afaik. Closing, but feel free to reopen if the status was put there to document something in the coding guidelines