Bug 40315

Summary: xt/tt_tidy.t generates warnings
Product: Koha Reporter: Jonathan Druart <jonathan.druart>
Component: Test SuiteAssignee: Jonathan Druart <jonathan.druart>
Status: Pushed to main --- QA Contact: Marcel de Rooy <m.de.rooy>
Severity: minor    
Priority: P5 - low CC: david, m.de.rooy, pedro.amorim, tomascohen
Version: unspecified   
Hardware: All   
OS: All   
GIT URL: Change sponsored?: ---
Patch complexity: Trivial patch Documentation contact:
Documentation submission: Text to go in the release notes:
Version(s) released in:
25.11.00
Circulation function:
Bug Depends on: 40444, 38340    
Bug Blocks: 25515    
Attachments: Bug 40315: Remove warnings from xt/tt_tidy.t
Bug 40315: Remove warnings from xt/tt_tidy.t
Bug 40315: Remove warnings from xt/tt_tidy.t
Bug 40315: (QA follow-up) Fix shebang for both tests

Description Jonathan Druart 2025-07-07 11:22:10 UTC
18:22:50 koha_1       | Something went wrong, Prettier generated an empty file. The original file was kept at misc/devel/tidy.pl line 112.
18:22:50 koha_1       | Something went wrong, Prettier generated an empty file. The original file was kept at misc/devel/tidy.pl line 112.
18:22:50 koha_1       | Something went wrong, Prettier generated an empty file. The original file was kept at misc/devel/tidy.pl line 112.

This is because those 3 files are empty:
koha-tmpl/intranet-tmpl/prog/en/includes/ill/backends/Standard/illview.inc
koha-tmpl/intranet-tmpl/prog/en/includes/ill/backends/Standard/shared/forms/other.inc
koha-tmpl/opac-tmpl/bootstrap/en/includes/ill/backends/Standard/shared/forms/other.inc

Is that expected?
Comment 1 Jonathan Druart 2025-07-18 12:44:28 UTC
Created attachment 184375 [details] [review]
Bug 40315: Remove warnings from xt/tt_tidy.t

Maybe we could remove the warnings from misc/devel/tidy.pl if the file
was originally empty but for now it feels safer to skip the tidy of
empty files

Test plan:
  prove xt/tt_tidy.t xt/use-test-no-warnings.t
should return green
Comment 2 David Nind 2025-07-18 21:47:33 UTC
The tests failed for me:

prove xt/tt_tidy.t xt/use-test-no-warnings.t
xt/tt_tidy.t ............... ok       
xt/use-test-no-warnings.t .. 1/2 
#   Failed test 'All Perl test files should contain Test::NoWarnings'
#   at xt/use-test-no-warnings.t line 58.
#          got: '8'
#     expected: '0'
# The following test files should use Test::NoWarnings:
# 	t/ImportBatch.t
# 	t/db_dependent/Auth.t
# 	t/db_dependent/Budgets.t
# 	t/db_dependent/Koha/Patron.t
# 	t/db_dependent/www/auth_values_input_www.t
# 	t/db_dependent/www/batch.t
# 	t/db_dependent/www/history.t
# 	t/db_dependent/www/search_utf8.t
# Looks like you failed 1 test of 2.
xt/use-test-no-warnings.t .. Dubious, test returned 1 (wstat 256, 0x100)
Failed 1/2 subtests 

Test Summary Report
-------------------
xt/use-test-no-warnings.t (Wstat: 256 (exited 1) Tests: 2 Failed: 1)
  Failed test:  1
  Non-zero exit status: 1
Files=2, Tests=862, 172 wallclock secs ( 0.03 usr  0.00 sys + 1335.50 cusr 411.00 csys = 1746.53 CPU)
Result: FAIL
Comment 3 Jonathan Druart 2025-07-21 07:29:03 UTC
Yes, this one needs the patches under bug 25515.

So you will need to apply the patches from bug 40371, bug 40379, bug 40401 and 18772 first.

They do not apply using git-bz because 25515 is an omnibus and does not have patches.
Comment 4 David Nind 2025-07-21 08:44:52 UTC
Created attachment 184426 [details] [review]
Bug 40315: Remove warnings from xt/tt_tidy.t

Maybe we could remove the warnings from misc/devel/tidy.pl if the file
was originally empty but for now it feels safer to skip the tidy of
empty files

Test plan:
  prove xt/tt_tidy.t xt/use-test-no-warnings.t
should return green

Signed-off-by: David Nind <david@davidnind.com>
Comment 5 Marcel de Rooy 2025-07-25 06:17:42 UTC
xt/use-test-no-warnings.t .. 1/2
#   Failed test 'All Perl test files should contain Test::NoWarnings'
#   at xt/use-test-no-warnings.t line 52.
#          got: '1'
#     expected: '0'
# The following test files should use Test::NoWarnings:
#       t/db_dependent/api/v1/cash_registers.t
Comment 6 Jonathan Druart 2025-07-25 07:01:16 UTC
(In reply to Marcel de Rooy from comment #5)
> xt/use-test-no-warnings.t .. 1/2
> #   Failed test 'All Perl test files should contain Test::NoWarnings'
> #   at xt/use-test-no-warnings.t line 52.
> #          got: '1'
> #     expected: '0'
> # The following test files should use Test::NoWarnings:
> #       t/db_dependent/api/v1/cash_registers.t

It's from bug 40444.
Comment 7 Marcel de Rooy 2025-07-25 07:31:10 UTC
Created attachment 184614 [details] [review]
Bug 40315: Remove warnings from xt/tt_tidy.t

Maybe we could remove the warnings from misc/devel/tidy.pl if the file
was originally empty but for now it feels safer to skip the tidy of
empty files

Test plan:
  prove xt/tt_tidy.t xt/use-test-no-warnings.t
should return green

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 8 Marcel de Rooy 2025-07-25 07:31:12 UTC
Created attachment 184615 [details] [review]
Bug 40315: (QA follow-up) Fix shebang for both tests

Including chmod 755 xt/use-test-no-warnings.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 9 Lucas Gass (lukeg) 2025-07-31 18:46:25 UTC
Nice work everyone!

Pushed to main for 25.11