-
-
Notifications
You must be signed in to change notification settings - Fork 52
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
Fix timezone issues when using rrule #329
Conversation
Test cases from https://github.com/jens-maus/node-ical/pull/231/files, tweaked slightly to get rid of errors
test/test.js
Outdated
@@ -11,6 +11,10 @@ const _ = require('underscore'); | |||
const moment = require('moment-timezone'); | |||
const ical = require('../node-ical.js'); | |||
|
|||
process.on('uncaughtException', error => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should such an exception not better crash the tests?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Uh this is some weird issue with vows.js where it doesn't properly catch thrown exceptions and won't tell you what the issue actually is (you get a bunch of "callback not fired" messages instead). I found this snippet online to try to fix it but it doesn't work, and I apparently forgot to take it back out. Here's what it outputs when there's a parsing error in the test:
$ npm run test
> [email protected] test
> xo && vows test/test.js && vows test/test-async.js && printf "\n"
···········································································································✗✗·
✗ Errored » callback not fired
in with test22.ics (testing dtstart of rrule with timezones) first event
in node-ical
in test/test.js✗ Errored » callback not fired
in with test22.ics (testing dtstart of rrule with timezones) second event
in node-ical
in test/test.js[
'✗ \x1B[31m\x1B[1mErrored\x1B[22m\x1B[39m » \x1B[1m108\x1B[22m honored ∙ \x1B[1m3\x1B[22m errored ∙ \x1B[1m4\x1B[22m dropped\n'
]
On that note, vows seems hopelessly outdated. It still uses util.print
, which was EOLed in Node 12.0.0. I had to make some changes in vow itself to get any useful output on errors.
@Apollon77 any chance you could take another look? |
I honestly did not really looked into the change itself, but a test it´s there which is great ... And I mainly stumbled over the process.on(...) ... sooo LGTM from my side - but as said without looking too deep into the change itself and potential implications |
@50an6xy06r6n Thanks for this PR. Please note, however, the failing CI checks for the windows builds. It seems some tests actually fail on the windows build of node-ical. So please correct. |
@50an6xy06r6n In addition, please comment how much different this PR is compared to #231 |
@jens-maus Ah I think the Windows CI failures are an issue with the new tests, and have to do with this:
Pretty sure updating the I think the biggest difference between this and #231 is that this is a more targeted change for the RRULE issue. The other PR I think also changes some other, unrelated behavior. I think our solutions to the RRULE issue are fundamentally the same, though we use different mechanisms for getting the local time. I copied the tests from that PR, so the behavior seems largely the same (minus the additional parsing behavior for "(GMT +XX:X0)" time zones) The other difference is that I'm updating this PR, and that one hasn't been touched in almost 2 years 😛 |
No problem. I can then start the CI check if it is still rejected for you. So please continue to fix this PR in getting the windows CI build running. However, please make sure that |
Windows hosts don't seem to recognize the Etc/GMT-2 timezone that's used in test22, so this should load that. Since it's only used in the test I don't think it should increase the bundle size
A different test22.ics has been added as part of jens-maus#332
@jens-maus ready for the CI checks to be re-run |
Thanks for your info. However, the unit tests still fail on windows. See:
|
@50an6xy06r6n it seems rrule.between is somewhat broken on windows. Similar things are reported for rrule.after, see jkbrzt/rrule#608. Thus changed the test cases to somewhat skip on windows until rrule is fixed. |
Oh nice, thanks for investigating and fixing it! |
An alternative implementation of #231. All tests seem to pass, including the ones added in #231.
Implementation is simpler, so hopefully this should be easier to review.