-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Make the app compatible with Xcode 14 #19119
Conversation
07d45f7
to
544118b
Compare
# This solution is suggested here: https://github.com/CocoaPods/CocoaPods/issues/11402#issuecomment-1189861270 | ||
# ==================================== | ||
# | ||
installer.pods_project.targets.each do |target| |
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.
🚫 | Combine this loop with the previous loop. |
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.
It's concerning that Danger didn't remove this comment after the rubocop:disable
annotation was added.
You can test the changes in WordPress from this Pull Request by:
|
You can test the changes in Jetpack from this Pull Request by:
|
.selectAlbum(atIndex: 0) | ||
if #available(iOS 16.0, *), XCUIDevice.isPhone { | ||
// After the UI interuption monitor handler is called, the "Recents" album is automatically tapped. | ||
// But this only happens on iPhone, not iPad... |
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.
It turns out, this "automatic album selection" is device specific. For example, it occurs on iPhone 13 mini, but not iPhone SE, not sure about other simulators. This now looks very much like a bug in Xcode beta, I'm thinking removing this code, and let affected tests fail (for now), and re-evaluate in next beta.
I'll convert this PR to draft and re-evaluate once next beta is out, since the behavior I noted above is too weird to be a legit change. |
I think I'll stop trying to fix these test failures and re-evaluate them in next beta, but I'll summarize their status:
|
@@ -84,7 +84,7 @@ public class MySiteScreen: ScreenObject { | |||
if XCUIDevice.isPad { | |||
removeButton = app.alerts.buttons.element(boundBy: 1) | |||
} else { | |||
removeButton = app.sheets.buttons.element(boundBy: 0) | |||
removeButton = app.buttons["Remove Site"] |
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.
Out of scope for this PR, but it would be great if we could have accessibility identifiers for this and the "Remove" used above. cc @wordpress-mobile/mobile-ui-testing-squad
Thank you for looking into these @crazytonyli
Fair. For what concerns the test failures, we could marked them with
We should be specifying the device. See: WordPress-iOS/fastlane/lanes/build.rb Lines 71 to 74 in 6fb3145
WordPress-iOS/.buildkite/pipeline.yml Line 79 in 6fb3145
If that device is not picked up when the tests run, then there's some issue in our tooling / Fastlane / the beta |
This issue has been fixed in beta 5. UI tests passed using iPhone 13, iPhone SE, and iPad mini on my Mac. |
All issues discovered so far have been fixed in Xcode 14 beta 6. I was hoping the change where action sheets aren't assigned a "Sheet" element type in UI test would be fixed in new betas, I doubt it's going to happen now. |
5ae7a65
to
cd1db7d
Compare
— WordPressIntents and WordPressStatsWidgets. This is a known issue documented in Xcode's release notes: > Generated Swift code that the Intent definition compiler produces > emits a warning when compiled: Hopefully this issue will be addressed in future betas, and then we can revert this commit.
In Xcode 14 beta 4, the element type of an action sheet is 'Other', rather than 'Sheet', which makes the `sheets` query fails. This might be a bug in Xcode beta.
db05f2e
to
169da2d
Compare
Hi @mokagio , this PR is finally ready for review. I've cleaned up the commit history and the changes in this PR now only contains what are necessary to be compatible with Xcode 14. |
# This solution is suggested here: https://github.com/CocoaPods/CocoaPods/issues/11402#issuecomment-1189861270 | ||
# ==================================== | ||
# | ||
installer.pods_project.targets.each do |target| |
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.
It's concerning that Danger didn't remove this comment after the rubocop:disable
annotation was added.
@@ -23036,6 +23036,7 @@ | |||
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; | |||
SWIFT_OBJC_BRIDGING_HEADER = "WordPressStatsWidgets/Supporting Files/WordPressStatsWidgets-Bridging-Header.h"; | |||
SWIFT_OPTIMIZATION_LEVEL = "-Onone"; | |||
SWIFT_TREAT_WARNINGS_AS_ERRORS = NO; |
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.
Sad it had to come to this in c7ffd64.
Hopefully we can remember to check this when a new beta comes.
Actually... What do you think about tracking known workaround like this one in a checklist somewhere, so that we can run it when a new beta is release?
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.
Sounds like a good idea. Any suggestions where to track this kind of issue?
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.
Would be helpful to know what made us unable to turn that back on.
Like, for the case where Swift Bridging Header generated by Xcode contained warnings (due to some CoreData methods, iirm), we ended up finding a solution by trampolining to a header that added push/pop diagnostics pragma around it, and that worked great. So maybe for whatever case we had there that once again prevented us from turning it on there's also a way?
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 had looked for some Swift compiler flags to suppress this particular warning, but I couldn't find any. I don't think Swift compiler support diagnosis pragma directive in clang (or has anything similar to it).
But I just noticed the warnings has gone away in Xcode 14. I've opened #19310 to revert this change.
Please note this PR goes to the
xcode-14-support
branch.Changes
This PR fixes a couple compiling issues on Xcode 14
app.sheets
query to return nothing.Solution: remove the
.sheets
query.Solution: turn off "Treat warnings as errors" in a couple targets. I'll keep an eye on these warnings and revert this change once this known issue is fixed.
Test Instructions
No test required, as this PR goes to
xcode-14-support
branch.