Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More DST unit tests (WIP) #32

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft

Conversation

lowell80
Copy link

This is a set of possible DST unit tests for inclusion. This includes issues reported in taichino#137. I'll keep this PR in draft mode for the time being. Not all of the unit tests fail, but quite a number of them do. Each test has a comment/docstring indicate if it's working or not at the time of creation.

Add unittests for "DST - croniter gets stuck iterating across DST change" taichino#137
Test include (1) as-reported using dateutil.tz, (2) reverse version (which
works fine), (3) pytz version which works in reverse time as well, but fails in
a different way moving forward in time.

Add little test helper function because remembering to use tz.localize() vs
datetime(tzinfo=tz) is silly, IMO.
Add additional DST unit tests.  3 are working, 1 fails.
@lowell80
Copy link
Author

@kiorky, regarding DST issues in general: I'm wondering if any inspiration can be had from something like https://www.npmjs.com/package/cron-parser. I'm not a big javascript guy myself, but I'm wondering if reviewing some their code could lead to some discoveries. There seems to be a number of similarities between the two libraries, other than programming language, of course, but possibly enough to peak at certain things like DST handling.

But in the meantime, I'm hoping that collecting failing DST unit tests will ultimately provide some additional insight or pattern.

@lowell80
Copy link
Author

Here's a interesting consolidation of different ways DST can be solved by scedulers. @kiorky, do any of these align with the approach taken by croniter (or otherwise seem desirable)? jmrozanec/cron-utils#213

@kiorky
Copy link
Owner

kiorky commented Oct 11, 2020

croniter philosophy is based on unix implementation, so the first choice.

@kiorky kiorky mentioned this pull request Oct 12, 2020
@kiorky
Copy link
Owner

kiorky commented Oct 12, 2020

@lowell80 im not finished yet, but i'm revamping the DST code trying to make it cleaner...

@kiorky
Copy link
Owner

kiorky commented Oct 12, 2020

You can see where i am in the associated PR, but it's in plain WIP even commited here with pdb's ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants