Bug 34968

Summary: t/Search.t does not do anything with Test::DBIx::Class
Product: Koha Reporter: Marcel de Rooy <m.de.rooy>
Component: Test SuiteAssignee: Marcel de Rooy <m.de.rooy>
Status: CLOSED FIXED QA Contact: Katrin Fischer <katrin.fischer>
Severity: trivial    
Priority: P5 - low CC: fridolin.somers
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,23.05.05,22.11.11
Circulation function:
Bug Depends on:    
Bug Blocks: 34336    
Attachments: Bug 34968: Remove unneeded module from Search.t
Bug 34968: Remove unneeded module from Search.t

Description Marcel de Rooy 2023-09-30 06:37:20 UTC
There are no fixtures here. Can just be removed from the test.
Comment 1 Marcel de Rooy 2023-09-30 06:44:08 UTC
Created attachment 156436 [details] [review]
Bug 34968: Remove unneeded module from Search.t

Test::DBIx::Class is not even used here.
Just like C4::Biblio.
We should remove TestBuilder too (this is t not t/db)!

Test plan:
Run t/Search.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 2 Marcel de Rooy 2023-09-30 06:44:38 UTC
Trivial (module cleanup): Self signoff
Comment 3 Katrin Fischer 2023-10-03 10:11:21 UTC
Why remove these tests?

-use_ok('C4::Search');
-can_ok('C4::Search',
-    qw/_build_initial_query/);
Comment 4 Marcel de Rooy 2023-10-03 11:25:41 UTC
(In reply to Katrin Fischer from comment #3)
> Why remove these tests?
> 
> -use_ok('C4::Search');
> -can_ok('C4::Search',
> -    qw/_build_initial_query/);

Calling use_ok does not really add anything to our tests (here and in general too).

We have a specific test that tests loading all modules in C4 and Koha in t/00-load.t. It will signal such a module.
If the module would not load (and it would still be signed off..), the specific test will fail too anyway.
For me the BEGIN blocks with use_ok are just unneeded ballast. We have no coding guideline to keep them and not one to remove them. It should not be a blocker for this report imo.
Comment 5 Katrin Fischer 2023-10-03 12:40:53 UTC
Created attachment 156503 [details] [review]
Bug 34968: Remove unneeded module from Search.t

Test::DBIx::Class is not even used here.
Just like C4::Biblio.
We should remove TestBuilder too (this is t not t/db)!

Test plan:
Run t/Search.t

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

Nice work everyone, thanks!
Comment 7 Fridolin Somers 2023-10-05 20:08:31 UTC
Pushed to 23.05.x for 23.05.05
Comment 8 Matt Blenkinsop 2023-10-17 17:12:17 UTC
Nice work everyone!

Pushed to oldstable for 22.11.x