Bug 24757

Summary: t/db_dependent/Koha/Patrons.t get_age fails on February 28 in a Leap Year
Product: Koha Reporter: Martin Renvoize <martin.renvoize>
Component: Test SuiteAssignee: Jonathan Druart <jonathan.druart>
Status: CLOSED FIXED QA Contact: Martin Renvoize <martin.renvoize>
Severity: normal    
Priority: P5 - low CC: 1joynelson
Version: master   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
20.05.00
Attachments: Bug 24757: Leap day failing tests - It's like we are on 2020-02-28
Bug 24757: Leap day failing tests - refactoring
Bug 24757: Leap day failing tests - Fix the tests!
Bug 24757: Add more tests
Bug 24757: Leap day failing tests - It's like we are on 2020-02-28
Bug 24757: Leap day failing tests - refactoring
Bug 24757: Leap day failing tests - Fix the tests!
Bug 24757: Add more tests
Bug 24757: (RM follow-up) Restore test count

Description Martin Renvoize 2020-02-28 10:37:43 UTC
As the title says, Koha/Patrons.t fails for get_age and is_valid_age when run on Feb 28th in a leap year.
Comment 1 Jonathan Druart 2020-03-02 09:59:34 UTC
Created attachment 99861 [details] [review]
Bug 24757: Leap day failing tests - It's like we are on 2020-02-28

Those tests were failing on 2020-02-28, next day was a leap day.
Let's fake time and recreate the failure
Comment 2 Jonathan Druart 2020-03-02 09:59:37 UTC
Created attachment 99862 [details] [review]
Bug 24757: Leap day failing tests - refactoring

Refactore the tests to add more of them after we fixed the failing ones.
Comment 3 Jonathan Druart 2020-03-02 09:59:40 UTC
Created attachment 99863 [details] [review]
Bug 24757: Leap day failing tests - Fix the tests!

The same day was returned, for a different subtraction.
Comment 4 Jonathan Druart 2020-03-02 09:59:43 UTC
Created attachment 99864 [details] [review]
Bug 24757: Add more tests

Now we want to make sure we are not missing another situation.
Comment 5 Martin Renvoize 2020-03-02 10:05:43 UTC
Created attachment 99865 [details] [review]
Bug 24757: Leap day failing tests - It's like we are on 2020-02-28

Those tests were failing on 2020-02-28, next day was a leap day.
Let's fake time and recreate the failure

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 6 Martin Renvoize 2020-03-02 10:05:46 UTC
Created attachment 99866 [details] [review]
Bug 24757: Leap day failing tests - refactoring

Refactore the tests to add more of them after we fixed the failing ones.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 7 Martin Renvoize 2020-03-02 10:05:49 UTC
Created attachment 99867 [details] [review]
Bug 24757: Leap day failing tests - Fix the tests!

The same day was returned, for a different subtraction.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 8 Martin Renvoize 2020-03-02 10:05:52 UTC
Created attachment 99868 [details] [review]
Bug 24757: Add more tests

Now we want to make sure we are not missing another situation.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 9 Martin Renvoize 2020-03-02 10:06:23 UTC
Code all makes sense, thanks for the diligent and clear working through it.

Passing QA
Comment 10 Martin Renvoize 2020-03-02 10:06:39 UTC
Nice work everyone!

Pushed to master for 20.05
Comment 11 Martin Renvoize 2020-03-03 10:31:28 UTC
Created attachment 99982 [details] [review]
Bug 24757: (RM follow-up) Restore test count

Somehow we lost a '0' on the test count for
t/db_dependent/Koha/Patrons.t

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 12 Martin Renvoize 2020-03-03 10:38:43 UTC
Nice work everyone!

Pushed to master for 20.05
Comment 13 Joy Nelson 2020-03-31 22:49:21 UTC
enhancement not backported to 19.11.x