-
Notifications
You must be signed in to change notification settings - Fork 123
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
Bug 1586738 - Add Glean-iOS MetricsPingScheduler #655
Conversation
Codecov Report
@@ Coverage Diff @@
## master #655 +/- ##
============================================
+ Coverage 74.69% 75.28% +0.59%
Complexity 266 266
============================================
Files 96 97 +1
Lines 5936 6070 +134
Branches 730 730
============================================
+ Hits 4434 4570 +136
+ Misses 966 964 -2
Partials 536 536
Continue to review full report at Codecov.
|
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.
I need to give this another look, especially the tests.
For a first pass I found a few nitpicky things, but overall this looks like some very solid work already.
Please do check it carefully, the last two tests in the file were especially troublesome due to async hell. |
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.
Do we have any way to modify the clock used in the test to e.g. simulate the time hopping a bit better?
That way we could also test timezones changes more reliably.
glean-core/ios/GleanTests/Scheduler/MetricsPingSchedulerTests.swift
Outdated
Show resolved
Hide resolved
glean-core/ios/GleanTests/Scheduler/MetricsPingSchedulerTests.swift
Outdated
Show resolved
Hide resolved
glean-core/ios/GleanTests/Scheduler/MetricsPingSchedulerTests.swift
Outdated
Show resolved
Hide resolved
We can change timezones but setting the date/time, even for tests seems to be possible only by scripting it from CLI. This SO post was the best I found from a quick search. Go Apple! |
Given @mdboom experience with the Android implementation, I'd recommend he takes at least one high level look at this. |
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.
|
||
/// Overloads the operator so that subtraction between two dates results in a TimeInterval representing | ||
/// the difference between them | ||
static func - (lhs: Date, rhs: Date) -> TimeInterval { |
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.
static func -
... it does look weird.
This adds the MetricsPingScheduler to the iOS bindings.