Bug 15029 - Tests fail if launched after 23:00
Summary: Tests fail if launched after 23:00
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Test Suite (show other bugs)
Version: master
Hardware: All All
: P5 - low major (vote)
Assignee: Jonathan Druart
QA Contact: Galen Charlton
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 18009
  Show dependency treegraph
 
Reported: 2015-10-19 15:17 UTC by Jonathan Druart
Modified: 2017-01-29 01:56 UTC (History)
4 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Bot Control: ---
When did the bot last check this:
Who signed the patch off:
Text to go in the release notes:


Attachments
Bug 15029: Make the IssueSlip tests pass even if launched after 23:00 (5.14 KB, patch)
2015-10-19 15:19 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 15029: Make the IssueSlip tests pass even if launched after 23:00 (5.19 KB, patch)
2015-10-20 14:10 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review
[PASSED QA] Bug 15029: Make the IssueSlip tests pass even if launched after 23:00 (5.26 KB, patch)
2015-10-20 17:20 UTC, Kyle M Hall
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Jonathan Druart 2015-10-19 15:17:24 UTC
% sudo date -s "2015-10-19 23:50:00";prove t/db_dependent/Members/IssueSlip.t
Mon 19 Oct 23:50:00 BST 2015
t/db_dependent/Members/IssueSlip.t ..         # Child (Hourly loans) exited without calling finalize()
    
    #   Failed test 'Hourly loans'
    #   at /home/koha/perl5/lib/perl5/Test/Builder.pm line 276.
The 'hour' parameter ("24") to DateTime::set did not pass the 'an integer between 0 and 23' callback
 at /usr/lib/i386-linux-gnu/perl5/5.20/DateTime.pm line 1944.
        DateTime::set(undef, "hour", 24) called at t/db_dependent/Members/IssueSlip.t line 200
        main::__ANON__() called at /home/koha/perl5/lib/perl5/Test/Builder.pm line 258
        Test::Builder::__ANON__() called at /home/koha/perl5/lib/perl5/Test/Builder.pm line 263
        eval {...} called at /home/koha/perl5/lib/perl5/Test/Builder.pm line 263
        Test::Builder::subtest(Test::Builder=HASH(0x9dd4818), "Hourly loans", CODE(0xd30bc20)) called at /home/koha/perl5/lib/perl5/Test/More.pm line 770
        Test::More::subtest("Hourly loans", CODE(0xd30bc20)) called at t/db_dependent/Members/IssueSlip.t line 259
        main::__ANON__() called at /home/koha/perl5/lib/perl5/Test/Builder.pm line 258
        Test::Builder::__ANON__() called at /home/koha/perl5/lib/perl5/Test/Builder.pm line 263
        eval {...} called at /home/koha/perl5/lib/perl5/Test/Builder.pm line 263
        Test::Builder::subtest(Test::Builder=HASH(0x9dd4818), "Issue slip", CODE(0xd13eb1c)) called at /home/koha/perl5/lib/perl5/Test/More.pm line 770
        Test::More::subtest("Issue slip", CODE(0xd13eb1c)) called at t/db_dependent/Members/IssueSlip.t line 261
    # Child (Issue slip) exited without calling finalize()
t/db_dependent/Members/IssueSlip.t .. 1/3 
#   Failed test 'Issue slip'
#   at /home/koha/perl5/lib/perl5/Test/Builder.pm line 276.
# Looks like you planned 3 tests but ran 1.
# Looks like you failed 1 test of 1 run.
# Looks like your test exited with 29 just after 1.
t/db_dependent/Members/IssueSlip.t .. Dubious, test returned 29 (wstat 7424, 0x1d00)
Failed 3/3 subtests 

Test Summary Report
-------------------
t/db_dependent/Members/IssueSlip.t (Wstat: 7424 Tests: 1 Failed: 1)
  Failed test:  1
  Non-zero exit status: 29
  Parse errors: Bad plan.  You planned 3 tests but ran 1.
Files=1, Tests=1,  2 wallclock secs ( 0.02 usr  0.00 sys +  1.60 cusr  0.04 csys =  1.66 CPU)
Result: FAIL
Comment 1 Jonathan Druart 2015-10-19 15:19:39 UTC Comment hidden (obsolete)
Comment 2 Jonathan Druart 2015-10-19 15:20:35 UTC
Ccing RM & RMaints
Comment 3 Tomás Cohen Arazi 2015-10-20 14:10:40 UTC Comment hidden (obsolete)
Comment 4 Kyle M Hall 2015-10-20 17:20:47 UTC
Created attachment 43660 [details] [review]
[PASSED QA] Bug 15029: Make the IssueSlip tests pass even if launched after 23:00

Prior to this patch, the tests did not pass if they were launched after
23:00.
DateTime complains if you ask for creating a date with hour => 24 (which
is logical so far).

Test plan:
0/ Don't apply this patch
1/ sudo date -s "2015-10-19 23:50:00";prove
t/db_dependent/Members/IssueSlip.t
2/ Apply this patch and repeat 1.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 5 Tomás Cohen Arazi 2015-10-20 18:26:46 UTC
Patch pushed to master.

Thanks Jonathan!
Comment 6 Chris Cormack 2015-10-24 08:29:21 UTC
Pushed to 3.20.x will be in 3.20.5