Bug 31108 - rename ./t/00-check-atomic-updates.pl extension to *.t
Summary: rename ./t/00-check-atomic-updates.pl extension to *.t
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Test Suite (show other bugs)
Version: 22.05
Hardware: All All
: P1 - high blocker
Assignee: Mason James
QA Contact: Testopia
URL:
Keywords:
Depends on: 19169
Blocks: 31466 31479
  Show dependency treegraph
 
Reported: 2022-07-06 07:48 UTC by Mason James
Modified: 2023-06-08 22:26 UTC (History)
6 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
22.11.00, 22.05.03-1, 21.11.11, 21.05.18
Circulation function:


Attachments
Bug 31108: add missing shebang line to ./t/00-check-atomic-updates.pl (921 bytes, patch)
2022-07-06 07:51 UTC, Mason James
Details | Diff | Splinter Review
Bug 31108: rename ./t/00-check-atomic-updates.pl extention to *.t (853 bytes, patch)
2022-07-06 10:57 UTC, Mason James
Details | Diff | Splinter Review
Bug 31108: rename ./t/00-check-atomic-updates.pl extension to *.t (852 bytes, patch)
2022-07-06 11:15 UTC, Mason James
Details | Diff | Splinter Review
Bug 31108: rename ./t/00-check-atomic-updates.pl extension to *.t (859 bytes, patch)
2022-07-06 11:54 UTC, David Nind
Details | Diff | Splinter Review
Bug 31108: rename ./t/00-check-atomic-updates.pl extension to *.t (933 bytes, patch)
2022-07-06 14:18 UTC, Jonathan Druart
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Mason James 2022-07-06 07:48:46 UTC
small patch to add missing shebang line to ./t/00-check-atomic-updates.pl

to test...

1/ run prove, test is not run :(
 prove ./t | grep 00-check-atomic-updates.pl | wc -l
 0

2/ apply patch 


3/ run prove, test is run :)
 prove ./t | grep 00-check-atomic-updates.pl | wc -l
 2
Comment 1 Mason James 2022-07-06 07:51:36 UTC
Created attachment 137198 [details] [review]
Bug 31108: add missing shebang line to ./t/00-check-atomic-updates.pl

small patch to add missing shebang line to ./t/00-check-atomic-updates.pl

to test...

1/ run prove, test is not run :(
 prove ./t | grep 00-check-atomic-updates.pl | wc -l
 0

2/ apply patch

3/ run prove, test is run :)
 prove ./t | grep 00-check-atomic-updates.pl | wc -l
 2
Comment 2 Jonathan Druart 2022-07-06 09:22:26 UTC
Why do we need it?
It's missing in some other files.
Why this path?

% git grep '/usr/bin/perl' t|wc -l
486

% git grep '/usr/bin/env perl' t|wc -l
43
Comment 3 Mason James 2022-07-06 10:57:22 UTC
Created attachment 137203 [details] [review]
Bug 31108: rename ./t/00-check-atomic-updates.pl extention to *.t

to test...

1/ run prove, test is not run :(
 prove ./t | grep 00-check-atomic-updates.pl | wc -l
 0

2/ apply patch

3/ run prove, test is run :)
 prove ./t | grep 00-check-atomic-updates.pl | wc -l
 2
Comment 4 Mason James 2022-07-06 10:57:55 UTC
(In reply to Jonathan Druart from comment #2)
> Why do we need it?

ah, my mistake - the solution was to rename the file :)
Comment 5 Mason James 2022-07-06 11:15:24 UTC
Created attachment 137204 [details] [review]
Bug 31108: rename ./t/00-check-atomic-updates.pl extension to *.t

to test...

1/ run prove, test is not run :(
 prove ./t | grep 00-check-atomic-updates.pl | wc -l
 0

2/ apply patch

3/ run prove, test is run :)
 prove ./t | grep 00-check-atomic-updates.t | wc -l
 2
Comment 6 David Nind 2022-07-06 11:54:20 UTC
Created attachment 137206 [details] [review]
Bug 31108: rename ./t/00-check-atomic-updates.pl extension to *.t

to test...

1/ run prove, test is not run :(
 prove ./t | grep 00-check-atomic-updates.pl | wc -l
 0

2/ apply patch

3/ run prove, test is run :)
 prove ./t | grep 00-check-atomic-updates.t | wc -l
 2

Signed-off-by: David Nind <david@davidnind.com>
Comment 7 David Nind 2022-07-06 11:55:13 UTC
This is what I get after running step 1:

prove ./t | grep 00-check-atomic-updates.pl | wc -l
Use of uninitialized value $_ in pattern match (m//) at /usr/share/perl5/PPIx/Regexp/Structure/Quantifier.pm line 117.
skipping ingest of QUOTES_413514.CEQ : filename exists at t/EdiTransport.t line 53.
Use of uninitialized value in concatenation (.) or string at /usr/share/perl5/MARC/File/XML.pm line 399, <__ANONIO__> chunk 1.
Use of uninitialized value in concatenation (.) or string at /usr/share/perl5/MARC/File/XML.pm line 399, <__ANONIO__> chunk 1.
Use of uninitialized value $DisplayLibraryFacets in string eq at /kohadevbox/koha/C4/Koha.pm line 442.
Use of uninitialized value $DisplayLibraryFacets in string eq at /kohadevbox/koha/C4/Koha.pm line 442.
Use of uninitialized value $DisplayLibraryFacets in string eq at /kohadevbox/koha/C4/Koha.pm line 455.
Use of uninitialized value $DisplayLibraryFacets in string eq at /kohadevbox/koha/C4/Koha.pm line 455.
Use of uninitialized value $cn_item in sprintf at /kohadevbox/koha/C4/ClassSplitRoutine/LCC.pm line 48.

    #   Failed test 'Logger did not init correctly without permission'
    #   at t/Logger.t line 52.
    # Looks like you failed 1 test of 10.

#   Failed test 'Test01 -- Simple tests for Koha::Logger'
#   at t/Logger.t line 74.
# Looks like you failed 1 test of 1.
0

This is what I get after running step 3:

prove ./t | grep 00-check-atomic-updates.pl | wc -l
Use of uninitialized value $_ in pattern match (m//) at /usr/share/perl5/PPIx/Regexp/Structure/Quantifier.pm line 117.
skipping ingest of QUOTES_413514.CEQ : filename exists at t/EdiTransport.t line 53.
Use of uninitialized value in concatenation (.) or string at /usr/share/perl5/MARC/File/XML.pm line 399, <__ANONIO__> chunk 1.
Use of uninitialized value in concatenation (.) or string at /usr/share/perl5/MARC/File/XML.pm line 399, <__ANONIO__> chunk 1.
Use of uninitialized value in string eq at /kohadevbox/koha/C4/Koha.pm line 315.
Use of uninitialized value in string eq at /kohadevbox/koha/C4/Koha.pm line 315.
Use of uninitialized value $DisplayLibraryFacets in string eq at /kohadevbox/koha/C4/Koha.pm line 442.
Use of uninitialized value $DisplayLibraryFacets in string eq at /kohadevbox/koha/C4/Koha.pm line 442.
Use of uninitialized value $DisplayLibraryFacets in string eq at /kohadevbox/koha/C4/Koha.pm line 455.
Use of uninitialized value $DisplayLibraryFacets in string eq at /kohadevbox/koha/C4/Koha.pm line 455.
Use of uninitialized value $cn_item in sprintf at /kohadevbox/koha/C4/ClassSplitRoutine/LCC.pm line 48.

    #   Failed test 'Logger did not init correctly without permission'
    #   at t/Logger.t line 52.
    # Looks like you failed 1 test of 10.

#   Failed test 'Test01 -- Simple tests for Koha::Logger'
#   at t/Logger.t line 74.
# Looks like you failed 1 test of 1.
0

Signing off as file is renamed and tests pass for prove t/00-check-atomic-updates.pl
Comment 8 Jonathan Druart 2022-07-06 14:18:18 UTC
Created attachment 137213 [details] [review]
Bug 31108: rename ./t/00-check-atomic-updates.pl extension to *.t

to test...

1/ run prove, test is not run :(
 prove ./t | grep 00-check-atomic-updates.pl | wc -l
 0

2/ apply patch

3/ run prove, test is run :)
 prove ./t | grep 00-check-atomic-updates.t | wc -l
 2

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 9 Tomás Cohen Arazi (tcohen) 2022-07-06 19:43:07 UTC
Pushed to master for 22.11.

Nice work everyone, thanks!
Comment 10 Mason James 2022-07-07 05:58:18 UTC
(In reply to Tomás Cohen Arazi from comment #9)
> Pushed to master for 22.11.
> 
> Nice work everyone, thanks!

thanks, can we push thru to o-o-stable
Comment 11 Mason James 2022-07-15 08:23:46 UTC
bumping to blocker for 22.05.03 release
Comment 12 Arthur Suzuki 2022-08-11 07:20:04 UTC
pushed to 21.11.x for 21.11.11
Comment 13 Victor Grousset/tuxayo 2022-08-13 16:02:34 UTC
Backported: Pushed to 21.05.x branch for 21.05.18

Nothing to document, marking resolved.
Comment 14 Aleisha Amohia 2022-08-25 23:01:23 UTC
Was this tested with an actual atomic update in the directory?

I had an atomic update in there named bug_X_-_add_syspref.pl and it caused the test to fail 

$ prove t/00-check-atomic-updates.t
t/00-check-atomic-updates.t .. 1/? 
#   Failed test 'check for unhandled atomic updates: bug_30880_-_add_option_OPACResultsUnavailableGroupingBy_syspref.pl'
#   at t/00-check-atomic-updates.t line 34.
#                   'bug_30880_-_add_option_OPACResultsUnavailableGroupingBy_syspref.pl'
#           matches '(?^u:.*pl$)'
# Looks like you failed 1 test of 7.
t/00-check-atomic-updates.t .. Dubious, test returned 1 (wstat 256, 0x100)
Failed 1/7 subtests 

Test Summary Report
-------------------
t/00-check-atomic-updates.t (Wstat: 256 Tests: 7 Failed: 1)
  Failed test:  5
  Non-zero exit status: 1
Files=1, Tests=7,  0 wallclock secs ( 0.01 usr  0.01 sys +  0.06 cusr  0.00 csys =  0.08 CPU)
Result: FAIL

Can anyone advise?
Comment 15 Aleisha Amohia 2022-08-25 23:20:10 UTC
I've opened Bug 31466 to handle this.
Comment 16 Aleisha Amohia 2022-08-25 23:34:58 UTC
Never mind it has been explained to me that the test is correct and those of us doing custom packages will need to change how we handle atomic updates.