Bug 24757 - t/db_dependent/Koha/Patrons.t get_age fails on February 28 in a Leap Year
Summary: t/db_dependent/Koha/Patrons.t get_age fails on February 28 in a Leap Year
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Test Suite (show other bugs)
Version: master
Hardware: All All
: P5 - low normal (vote)
Assignee: Jonathan Druart
QA Contact: Martin Renvoize
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-02-28 10:37 UTC by Martin Renvoize
Modified: 2020-11-30 21:49 UTC (History)
1 user (show)

See Also:
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 (6.24 KB, patch)
2020-03-02 09:59 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 24757: Leap day failing tests - refactoring (7.07 KB, patch)
2020-03-02 09:59 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 24757: Leap day failing tests - Fix the tests! (2.08 KB, patch)
2020-03-02 09:59 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 24757: Add more tests (3.97 KB, patch)
2020-03-02 09:59 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 24757: Leap day failing tests - It's like we are on 2020-02-28 (6.30 KB, patch)
2020-03-02 10:05 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 24757: Leap day failing tests - refactoring (7.13 KB, patch)
2020-03-02 10:05 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 24757: Leap day failing tests - Fix the tests! (2.15 KB, patch)
2020-03-02 10:05 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 24757: Add more tests (4.03 KB, patch)
2020-03-02 10:05 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 24757: (RM follow-up) Restore test count (810 bytes, patch)
2020-03-03 10:31 UTC, Martin Renvoize
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
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