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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

RUMM-1324 Fix RUM views tracking issue for iOS 11 (and make tests green for 11.x and 12.x) #474

Merged
merged 3 commits into from Apr 27, 2021

Conversation

ncreated
Copy link
Collaborator

What and why?

馃摝 This PR fixes RUM Views auto-instrumentation issue for iOS 11 and fixes unit tests issues for iOS 11.x and 12.x.

How?

RUM Views auto-instrumentation issue for iOS 11

Views instrumentation opts-out from tracking "bare" UIKit view controllers. This is determined by checking if the vc class is defined inside UIKitCore.framework. This check was failing for iOS 11, because it ships UIKit.framework instead of UIKitCore.framework.

Tests failures for iOS 11.x and 12.x

Several encoding-related tests were fixed for versions prior to iOS 13. They were failing due to known limitation of JSON encoder on iOS 11 and 12 - it can only encode object or array as the root type.

Running all unit tests nightly on iOS 11.x-14.x

To mitigate this kind of regression in the future, I was trying to configure nightly job for running tests on all iOS versions on Bitrise CI. Unfortunately, I couldn't find a good solution to set it up. I've contacted Bitrise support for guidance and recommendation. What I've tried so far:

  • using distinct Bitrise stacks to spin separate workflows for iOS 11, 12, 13 and 14,
  • installing additional simulators on Xcode 12.x stack with xcode-install.

The first approach requires patching xcframeworks to frameworks for Xcode 11.x and 10.x. I did it, but then faced the swift compiler issue, as some of the APIs are not available on older versions of the compiler. This way seems to be too error-prone and very hard to maintain. (note: supporting older versions of Xcode is not our focus as Apple keeps the bar high, with enforcing Xcode 12 for App Store submissions)

The second approach seems promising (simulator download takes ~1min on Bitrise), but it's blocked by xcode-install failing with "Please authenticate to install iOS ##.# Simulator...". This appears to come from required sudo permission. I've contacted Bitrise support to ask on that.

Until getting response from Bitrise support, we can consider this topic closed. Separate JIRA was created for configuring nightly run once we unblock this topic.

Review checklist

  • Feature or bugfix MUST have appropriate tests (unit, integration)
  • Make sure each commit and the PR mention the Issue number or JIRA reference

RUM Views corresponding to plain UIKit view controllers were not
named correctly as the SDK check for "is UIKit VC" was failing on iOS11.
The test was failing on unwrapping `nil` as we were asking for `presentingViewController`
too early, before it was set by the UIKit.
Prior to iOS 13, the value encoded with JSON encoder must be array or object
@ncreated ncreated self-assigned this Apr 27, 2021
@ncreated ncreated requested a review from a team as a code owner April 27, 2021 10:59
@ncreated ncreated merged commit 1cd1a46 into master Apr 27, 2021
@ncreated ncreated deleted the ncreated/RUMM-1324-fix-test-issues-on-iOS-11-and-12 branch April 27, 2021 17:17
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.

None yet

2 participants