Skip to content
This repository was archived by the owner on Aug 8, 2023. It is now read-only.

refs #1491: metrics testing - #1517

Merged
incanus merged 2 commits into
masterfrom
metrics-tests
May 12, 2015
Merged

incanus merged 2 commits into
masterfrom
metrics-tests

Conversation

@incanus

@incanus incanus commented May 12, 2015

Copy link
Copy Markdown
Contributor

Before landing #1491, we should be thinking about better metrics testing. This is a start towards testing various functionality in MGLMapboxEvents to:

  1. Get me familiar with it a bit more.
  2. Be in better shape to adapt the tests that break / need new coverage to land Refactor MGLMapboxEvents #1491.

So far it tests a couple things we've been leaving uncovered:

  • That setting a token on the map view sets it for metrics as well.
  • That flush (public API) empties the events queue.
  • That pushing events adds to the events queue.

I am using the popular OCMock to test this functionality.

Things still to test:

  • That flushing posts certain network requests.
  • Opting out of metrics does what we think it does.
  • The at-run-time changes to opt-out that Refactor MGLMapboxEvents #1491 hopes to address.
  • etc.

We can likely use OHHTTPStubs for this network testing.

Lastly, I turned up #1516 along the way and my last test (testPushEventAddsToEventQueue) is currently broken as a result.

/cc @bleege @1ec5

@incanus incanus added iOS Mapbox Maps SDK for iOS telemetry Integration with Mapbox Telemetry libraries labels May 12, 2015
@incanus incanus added this to the iOS Beta 1 milestone May 12, 2015
Comment thread test/ios/MetricsTests.m

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#1491 turns -[MGLMapboxEvents flushAfter] into a constant, MGLFlushInterval, because it wasn’t being modified anywhere at runtime. I’m fine with exposing the constant to these tests, but given that modifying the flush interval will no longer be supported, it won’t be necessary to test that case.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I did this just to cut down on testing time. Not a big deal.

@1ec5

1ec5 commented May 12, 2015

Copy link
Copy Markdown
Contributor

Looks good from here.

@incanus

incanus commented May 12, 2015

Copy link
Copy Markdown
Contributor Author

Going to squash & merge these into master and then ios-b1 as they:

  1. Pass locally, except for the last one, which properly tests runtime opt-out.
  2. Only affect test/ios; no library code.
  3. Aren't run automatically because of reenable iOS tests #1452.

incanus added a commit that referenced this pull request May 12, 2015
@incanus
incanus merged commit 50d7add into master May 12, 2015
@incanus
incanus deleted the metrics-tests branch May 12, 2015 20:54
@1ec5 1ec5 changed the title [not ready] refs #1491: metrics testing refs #1491: metrics testing May 12, 2015
incanus added a commit that referenced this pull request May 13, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

iOS Mapbox Maps SDK for iOS telemetry Integration with Mapbox Telemetry libraries

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants