Not sure what is behind this. kohadev-koha@kohadevbox:/home/vagrant/kohaclone$ date Fri Jun 28 13:02:16 -05 2019 kohadev-koha@kohadevbox:/home/vagrant/kohaclone$ prove t/db_dependent/Circulation.t # Failed test 'Cannot auto renew, too late - no_auto_renewal_after is inclusive(returned code is auto_too_late)' # at t/db_dependent/Circulation.t line 691. # got: 'auto_too_soon' # expected: 'auto_too_late' # Looks like you failed 1 test of 14. # Failed test 'too_late_renewal / no_auto_renewal_after' # at t/db_dependent/Circulation.t line 722. # Failed test 'GetLatestAutoRenewDate should return -5 days if no_auto_renewal_after = 5 and date_due is 10 days before' # at t/db_dependent/Circulation.t line 862. # got: '2019-06-23T18:01:00' # expected: '2019-06-23T18:01:00' # Failed test 'GetLatestAutoRenewDate should return +5 days if no_auto_renewal_after = 15 and date_due is 10 days before' # at t/db_dependent/Circulation.t line 869. # got: '2019-07-03T18:01:00' # expected: '2019-07-03T18:01:00' # Failed test 'GetLatestAutoRenewDate should return +2 days if no_auto_renewal_after_hard_limit is defined and not no_auto_renewal_after' # at t/db_dependent/Circulation.t line 876. # got: '2019-06-30T00:00:00' # expected: '2019-06-30T00:00:00' # Failed test 'GetLatestAutoRenewDate should return +2 days if no_auto_renewal_after_hard_limit is < no_auto_renewal_after' # at t/db_dependent/Circulation.t line 882. # got: '2019-06-30T00:00:00' # expected: '2019-06-30T00:00:00' # Looks like you failed 4 tests of 5. # Failed test 'GetLatestAutoRenewDate' # at t/db_dependent/Circulation.t line 887. # Looks like you failed 2 tests of 71. # Failed test 'CanBookBeRenewed tests' # at t/db_dependent/Circulation.t line 998. # Failed test 'AddReturn must have debarred the patron' # at t/db_dependent/Circulation.t line 86. # got: '' # expected: '1' # AddReturn returned message $VAR1 = { # 'WasReturned' => 1 # }; # Failed test 'Test at line 1967' # at t/db_dependent/Circulation.t line 90. # got: '0' # expected: '1' # Failed test 'Test at line 1967' # at t/db_dependent/Circulation.t line 93. # got: undef # expected: '2019-07-12' # Looks like you failed 3 tests of 21. # Failed test 'AddReturn + suspension_chargeperiod' # at t/db_dependent/Circulation.t line 1976. # Looks like you failed 2 tests of 45. t/db_dependent/Circulation.t .. Dubious, test returned 2 (wstat 512, 0x200) Failed 2/45 subtests Test Summary Report ------------------- t/db_dependent/Circulation.t (Wstat: 512 Tests: 45 Failed: 2) Failed tests: 15, 29 Non-zero exit status: 2 Files=1, Tests=45, 27 wallclock secs ( 0.08 usr 0.01 sys + 19.81 cusr 4.37 csys = 24.27 CPU) Result: FAIL
Created attachment 94652 [details] [review] Bug 23234: Mock DateTime->now using the time zone The timezone of the two dt was different, one was UTC, the other one was my local one. When we mocked DateTime->now we did not use the time zone, we must use dt_from_string instead Test plan: Make sure your environment has a different time zone than UTC `prove t/db_dependent/Circulation.t` should fail without this patch
Upping severity, it's very annoying for people hitting this one (hard to write or execute those tests).
Created attachment 95025 [details] [review] Bug 23234: Mock DateTime->now using the time zone The timezone of the two dt was different, one was UTC, the other one was my local one. When we mocked DateTime->now we did not use the time zone, we must use dt_from_string instead Test plan: Make sure your environment has a different time zone than UTC `prove t/db_dependent/Circulation.t` should fail without this patch Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
An annoying bug that's fixed nicely here.. Going straight for QA
Nice work! Pushed to master for 19.11.00
Pushed to 19.05.x for 19.05.05