Bug 34968 - t/Search.t does not do anything with Test::DBIx::Class
Summary: t/Search.t does not do anything with Test::DBIx::Class
Status: Pushed to oldstable
Alias: None
Product: Koha
Classification: Unclassified
Component: Test Suite (show other bugs)
Version: Main
Hardware: All All
: P5 - low trivial (vote)
Assignee: Marcel de Rooy
QA Contact: Katrin Fischer
URL:
Keywords:
Depends on:
Blocks: 34336
  Show dependency treegraph
 
Reported: 2023-09-30 06:37 UTC by Marcel de Rooy
Modified: 2023-10-17 17:12 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.11


Attachments
Bug 34968: Remove unneeded module from Search.t (1.52 KB, patch)
2023-09-30 06:44 UTC, Marcel de Rooy
Details | Diff | Splinter Review
Bug 34968: Remove unneeded module from Search.t (1.53 KB, patch)
2023-10-03 12:40 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-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 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