From c7ffd640a7d388559789802e2fa25ba75e674691 Mon Sep 17 00:00:00 2001 From: Tony Li Date: Thu, 28 Jul 2022 13:53:02 +1200 Subject: [PATCH 1/5] Disable "Treat Warnings as Errors" in two targets MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit — 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. --- WordPress/WordPress.xcodeproj/project.pbxproj | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/WordPress/WordPress.xcodeproj/project.pbxproj b/WordPress/WordPress.xcodeproj/project.pbxproj index 7f9580e0669b..2705f45b4bd4 100644 --- a/WordPress/WordPress.xcodeproj/project.pbxproj +++ b/WordPress/WordPress.xcodeproj/project.pbxproj @@ -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; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; WPCOM_SCHEME = wpdebug; @@ -23088,6 +23089,7 @@ PROVISIONING_PROFILE_SPECIFIER = "match AppStore org.wordpress.WordPressStatsWidgets"; SKIP_INSTALL = YES; SWIFT_OBJC_BRIDGING_HEADER = "WordPressStatsWidgets/Supporting Files/WordPressStatsWidgets-Bridging-Header.h"; + SWIFT_TREAT_WARNINGS_AS_ERRORS = NO; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; WPCOM_SCHEME = wordpress; @@ -23141,6 +23143,7 @@ PROVISIONING_PROFILE_SPECIFIER = "match InHouse org.wordpress.internal.WordPressStatsWidgets"; SKIP_INSTALL = YES; SWIFT_OBJC_BRIDGING_HEADER = "WordPressStatsWidgets/Supporting Files/WordPressStatsWidgets-Bridging-Header.h"; + SWIFT_TREAT_WARNINGS_AS_ERRORS = NO; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; WPCOM_SCHEME = wpinternal; @@ -23194,6 +23197,7 @@ PROVISIONING_PROFILE_SPECIFIER = "match InHouse org.wordpress.alpha.WordPressStatsWidgets"; SKIP_INSTALL = YES; SWIFT_OBJC_BRIDGING_HEADER = "WordPressStatsWidgets/Supporting Files/WordPressStatsWidgets-Bridging-Header.h"; + SWIFT_TREAT_WARNINGS_AS_ERRORS = NO; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; WPCOM_SCHEME = wpalpha; @@ -25711,6 +25715,7 @@ SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; SWIFT_OBJC_BRIDGING_HEADER = "WordPressIntents/Supporting Files/WordPressIntents-Bridging-Header.h"; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_TREAT_WARNINGS_AS_ERRORS = NO; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; WPCOM_SCHEME = wpdebug; @@ -25761,6 +25766,7 @@ PROVISIONING_PROFILE_SPECIFIER = "match AppStore org.wordpress.WordPressIntents"; SKIP_INSTALL = YES; SWIFT_OBJC_BRIDGING_HEADER = "WordPressIntents/Supporting Files/WordPressIntents-Bridging-Header.h"; + SWIFT_TREAT_WARNINGS_AS_ERRORS = NO; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; WPCOM_SCHEME = wordpress; @@ -25812,6 +25818,7 @@ PROVISIONING_PROFILE_SPECIFIER = "match InHouse org.wordpress.internal.WordPressIntents"; SKIP_INSTALL = YES; SWIFT_OBJC_BRIDGING_HEADER = "WordPressIntents/Supporting Files/WordPressIntents-Bridging-Header.h"; + SWIFT_TREAT_WARNINGS_AS_ERRORS = NO; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; WPCOM_SCHEME = wpinternal; @@ -25863,6 +25870,7 @@ PROVISIONING_PROFILE_SPECIFIER = "match InHouse org.wordpress.alpha.WordPressIntents"; SKIP_INSTALL = YES; SWIFT_OBJC_BRIDGING_HEADER = "WordPressIntents/Supporting Files/WordPressIntents-Bridging-Header.h"; + SWIFT_TREAT_WARNINGS_AS_ERRORS = NO; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; WPCOM_SCHEME = wpalpha; From 07b1cd49fd35fcd3de1b151711a2a36618b31a8c Mon Sep 17 00:00:00 2001 From: Tony Li Date: Fri, 29 Jul 2022 15:59:07 +1200 Subject: [PATCH 2/5] Disable a linting issue in Podfile for now --- Podfile | 13 +++++++++++++ Podfile.lock | 2 +- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/Podfile b/Podfile index a49c89c666a7..64c047e168ad 100644 --- a/Podfile +++ b/Podfile @@ -454,6 +454,19 @@ post_install do |installer| end end + # Fix a code signing issue in Xcode 14 beta. + # This solution is suggested here: https://github.com/CocoaPods/CocoaPods/issues/11402#issuecomment-1189861270 + # ==================================== + # + # TODO: fix the linting issue if this workaround is still needed in Xcode 14 GM. + # rubocop:disable Style/CombinableLoops + installer.pods_project.targets.each do |target| + target.build_configurations.each do |config| + config.build_settings['CODE_SIGN_IDENTITY'] = '' + end + end + # rubocop:enable Style/CombinableLoops + # Flag Alpha builds for Tracks # ============================ # diff --git a/Podfile.lock b/Podfile.lock index 63ea887130e1..5d3264b244e3 100644 --- a/Podfile.lock +++ b/Podfile.lock @@ -880,6 +880,6 @@ SPEC CHECKSUMS: ZendeskSupportSDK: 3a8e508ab1d9dd22dc038df6c694466414e037ba ZIPFoundation: ae5b4b813d216d3bf0a148773267fff14bd51d37 -PODFILE CHECKSUM: 0a5d385d3dfa6cacba438a4c36fc4af818da7fb0 +PODFILE CHECKSUM: ff681823a6ae5d572f31ac32da22538922bd5471 COCOAPODS: 1.11.2 From c4a5009346dc82c23668849a38e560ba863f85da Mon Sep 17 00:00:00 2001 From: Tony Li Date: Mon, 1 Aug 2022 16:43:45 +1200 Subject: [PATCH 3/5] Fix looking up buttons in action sheets in UI test 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. --- .../Screens/Editor/BlockEditorScreen.swift | 6 +++--- .../Screens/Editor/FeaturedImageScreen.swift | 2 +- WordPress/UITestsFoundation/Screens/MySiteScreen.swift | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/WordPress/UITestsFoundation/Screens/Editor/BlockEditorScreen.swift b/WordPress/UITestsFoundation/Screens/Editor/BlockEditorScreen.swift index b9edc2c2be54..6de3ee9f5c47 100644 --- a/WordPress/UITestsFoundation/Screens/Editor/BlockEditorScreen.swift +++ b/WordPress/UITestsFoundation/Screens/Editor/BlockEditorScreen.swift @@ -144,7 +144,7 @@ public class BlockEditorScreen: ScreenObject { public func openPostSettings() throws -> EditorPostSettings { moreButton.tap() - let postSettingsButton = app.sheets.buttons["Post Settings"] // Uses a localized string + let postSettingsButton = app.buttons["Post Settings"] // Uses a localized string postSettingsButton.tap() return try EditorPostSettings() @@ -163,7 +163,7 @@ public class BlockEditorScreen: ScreenObject { app.otherElements["PopoverDismissRegion"].tap() dismissImageViewIfNeeded() } else { - app.sheets.buttons["Keep Editing"].tap() + app.buttons["Keep Editing"].tap() } } @@ -219,7 +219,7 @@ public class BlockEditorScreen: ScreenObject { } private func chooseFromDevice() throws -> MediaPickerAlbumScreen { - let imageDeviceButton = app.sheets.buttons["Choose from device"] // Uses a localized string + let imageDeviceButton = app.buttons["Choose from device"] // Uses a localized string imageDeviceButton.tap() diff --git a/WordPress/UITestsFoundation/Screens/Editor/FeaturedImageScreen.swift b/WordPress/UITestsFoundation/Screens/Editor/FeaturedImageScreen.swift index dab842cd8a1d..85fa28be4af4 100644 --- a/WordPress/UITestsFoundation/Screens/Editor/FeaturedImageScreen.swift +++ b/WordPress/UITestsFoundation/Screens/Editor/FeaturedImageScreen.swift @@ -16,7 +16,7 @@ public class FeaturedImageScreen: ScreenObject { public func tapRemoveFeaturedImageButton() { removeButton.tap() - app.sheets.buttons.element(boundBy: 0).tap() + app.buttons["Remove"].tap() } } diff --git a/WordPress/UITestsFoundation/Screens/MySiteScreen.swift b/WordPress/UITestsFoundation/Screens/MySiteScreen.swift index e389513bb62b..f29e7787662e 100644 --- a/WordPress/UITestsFoundation/Screens/MySiteScreen.swift +++ b/WordPress/UITestsFoundation/Screens/MySiteScreen.swift @@ -94,7 +94,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"] } removeButton.tap() From 9acbbf695d2458f11119b179bee908f48510ee4b Mon Sep 17 00:00:00 2001 From: Tony Li Date: Fri, 9 Sep 2022 09:47:53 +1200 Subject: [PATCH 4/5] Use iPhone SE to run UI tests --- .buildkite/pipeline.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index 7e36c98c8cae..4860f25fe181 100644 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -76,7 +76,7 @@ steps: - group: "🔬 UI Tests" steps: - label: "🔬 UI Tests (iPhone)" - command: .buildkite/commands/run-ui-tests.sh 'iPhone 13' + command: .buildkite/commands/run-ui-tests.sh 'iPhone SE (3rd generation)' depends_on: "build" env: *common_env plugins: *common_plugins From 169da2d0b33f61e3814ed7323046942d34d6a147 Mon Sep 17 00:00:00 2001 From: Tony Li Date: Fri, 29 Jul 2022 12:42:33 +1200 Subject: [PATCH 5/5] Use Xcode 14 on CI --- .buildkite/pipeline.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index 4860f25fe181..3cd72ad1eef6 100644 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -12,7 +12,7 @@ common_params: # # `xcode-13.4.1` note: The issue "FIXIT-13.1" addresses is still there in this image. # See: https://buildkite.com/automattic/wordpress-ios/builds/8187#01813c28-1c1d-4a25-95c0-0fdd6f2af399 - IMAGE_ID: xcode-13.4.1 + IMAGE_ID: xcode-14 # This is the default pipeline – it will build and test the app steps: