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

Commit 712dcc1

Browse files
author
Chris Yang
authored
[ci][image_picker]enable xcode 12/iOS 14 for all tasks except lint (#3304)
1 parent 6783cd5 commit 712dcc1

File tree

4 files changed

+58
-18
lines changed

4 files changed

+58
-18
lines changed

.cirrus.yml

Lines changed: 36 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ task:
117117
env:
118118
INTEGRATION_TEST_PATH: "./packages/integration_test"
119119
upgrade_script:
120+
- sudo gem install cocoapods
120121
- flutter channel stable
121122
- flutter upgrade
122123
- flutter channel master
@@ -134,13 +135,14 @@ task:
134135
- xvfb-run ./script/incremental_build.sh drive-examples --linux
135136

136137
task:
138+
# Xcode 11 task
139+
# TODO(cyanglaz): merge Xcode 11 task to Xcode 12 task when all the matrix can be run in Xcode 12.
137140
# don't run on release tags since it creates O(n^2) tasks where n is the number of plugins
138141
only_if: $CIRRUS_TAG == ''
139142
use_compute_credits: $CIRRUS_USER_COLLABORATOR == 'true'
140143
osx_instance:
141144
image: catalina-xcode-11.3.1-flutter
142145
upgrade_script:
143-
- sudo gem install cocoapods
144146
- flutter channel stable
145147
- flutter upgrade
146148
- flutter channel master
@@ -151,17 +153,6 @@ task:
151153
- xcrun simctl list
152154
- xcrun simctl create Flutter-iPhone com.apple.CoreSimulator.SimDeviceType.iPhone-X com.apple.CoreSimulator.SimRuntime.iOS-13-3 | xargs xcrun simctl boot
153155
matrix:
154-
- name: build_all_plugins_ipa
155-
env:
156-
matrix:
157-
CHANNEL: "master"
158-
CHANNEL: "stable"
159-
script:
160-
# TODO(jackson): Allow web plugins once supported on stable
161-
# https://github.com/flutter/flutter/issues/42864
162-
- if [[ "$CHANNEL" -eq "stable" ]]; then find . | grep _web$ | xargs rm -rf; fi
163-
- flutter channel $CHANNEL
164-
- ./script/build_all_plugins_app.sh ios --no-codesign
165156
- name: lint_darwin_plugins
166157
env:
167158
matrix:
@@ -173,6 +164,37 @@ task:
173164
# Skip the dummy podspecs used to placate the tool.
174165
- find . -name "*_web*.podspec" -o -name "*_mac*.podspec" | xargs rm
175166
- ./script/incremental_build.sh podspecs
167+
168+
task:
169+
# Xcode 12 task
170+
# don't run on release tags since it creates O(n^2) tasks where n is the number of plugins
171+
only_if: $CIRRUS_TAG == ''
172+
use_compute_credits: $CIRRUS_USER_COLLABORATOR == 'true'
173+
osx_instance:
174+
image: big-sur-xcode-12.3
175+
upgrade_script:
176+
- sudo gem install cocoapods
177+
- flutter channel stable
178+
- flutter upgrade
179+
- flutter channel master
180+
- flutter upgrade
181+
- git fetch origin master
182+
activate_script: pub global activate flutter_plugin_tools
183+
create_simulator_script:
184+
- xcrun simctl list
185+
- xcrun simctl create Flutter-iPhone com.apple.CoreSimulator.SimDeviceType.iPhone-11 com.apple.CoreSimulator.SimRuntime.iOS-14-3 | xargs xcrun simctl boot
186+
matrix:
187+
- name: build_all_plugins_ipa
188+
env:
189+
matrix:
190+
CHANNEL: "master"
191+
CHANNEL: "stable"
192+
script:
193+
# TODO(jackson): Allow web plugins once supported on stable
194+
# https://github.com/flutter/flutter/issues/42864
195+
- if [[ "$CHANNEL" -eq "stable" ]]; then find . | grep _web$ | xargs rm -rf; fi
196+
- flutter channel $CHANNEL
197+
- ./script/build_all_plugins_app.sh ios --no-codesign
176198
- name: build-ipas+drive-examples
177199
env:
178200
PATH: $PATH:/usr/local/bin
@@ -193,13 +215,13 @@ task:
193215
- flutter channel $CHANNEL
194216
- ./script/incremental_build.sh build-examples --ipa
195217
- ./script/incremental_build.sh drive-examples
196-
- ./script/incremental_build.sh xctest --target RunnerUITests --skip $PLUGINS_TO_SKIP_XCTESTS
218+
- ./script/incremental_build.sh xctest --target RunnerUITests --skip $PLUGINS_TO_SKIP_XCTESTS --ios-destination "platform=iOS Simulator,name=iPhone 11,OS=14.3"
197219
task:
198220
# don't run on release tags since it creates O(n^2) tasks where n is the number of plugins
199221
only_if: $CIRRUS_TAG == ''
200222
use_compute_credits: $CIRRUS_USER_COLLABORATOR == 'true'
201223
osx_instance:
202-
image: catalina-xcode-11.3.1-flutter
224+
image: big-sur-xcode-12.3
203225
setup_script:
204226
- flutter config --enable-macos-desktop
205227
upgrade_script:

packages/image_picker/image_picker/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 0.6.7+22
2+
3+
* iOS: update XCUITests to separate each test session.
4+
15
## 0.6.7+21
26

37
* Update the example app: remove the deprecated `RaisedButton` and `FlatButton` widgets.

packages/image_picker/image_picker/example/ios/RunnerUITests/ImagePickerFromGalleryUITests.m

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ @interface ImagePickerFromGalleryUITests : XCTestCase
1616
@implementation ImagePickerFromGalleryUITests
1717

1818
- (void)setUp {
19+
[super setUp];
1920
// Delete the app if already exists, to test permission popups
2021

2122
self.continueAfterFailure = NO;
@@ -31,7 +32,7 @@ - (void)setUp {
3132
if (![allPhotoPermission waitForExistenceWithTimeout:
3233
kElementWaitingTime]) {
3334
os_log_error(OS_LOG_DEFAULT, "%@",
34-
self.app.debugDescription);
35+
weakSelf.app.debugDescription);
3536
XCTFail(@"Failed due to not able to find "
3637
@"allPhotoPermission button with %@ seconds",
3738
@(kElementWaitingTime));
@@ -42,7 +43,7 @@ - (void)setUp {
4243
if (![ok waitForExistenceWithTimeout:
4344
kElementWaitingTime]) {
4445
os_log_error(OS_LOG_DEFAULT, "%@",
45-
self.app.debugDescription);
46+
weakSelf.app.debugDescription);
4647
XCTFail(@"Failed due to not able to find ok button "
4748
@"with %@ seconds",
4849
@(kElementWaitingTime));
@@ -53,11 +54,19 @@ - (void)setUp {
5354
}];
5455
}
5556

57+
- (void)tearDown {
58+
[super tearDown];
59+
[self.app terminate];
60+
}
61+
5662
- (void)testPickingFromGallery {
57-
[self launchPickerAndCancel];
5863
[self launchPickerAndPick];
5964
}
6065

66+
- (void)testCancel {
67+
[self launchPickerAndCancel];
68+
}
69+
6170
- (void)launchPickerAndCancel {
6271
// Find and tap on the pick from gallery button.
6372
NSPredicate* predicateToFindImageFromGalleryButton =
@@ -160,6 +169,10 @@ - (void)launchPickerAndPick {
160169
XCTAssertTrue(pickButton.exists);
161170
[pickButton tap];
162171

172+
// There is a known bug where the permission popups interruption won't get fired until a tap
173+
// happened in the app. We expect a permission popup so we do a tap here.
174+
[self.app tap];
175+
163176
// Find an image and tap on it. (IOS 14 UI, images are showing directly)
164177
XCUIElement* aImage;
165178
if (@available(iOS 14, *)) {
@@ -177,6 +190,7 @@ - (void)launchPickerAndPick {
177190
identifier:@"PhotosGridView"]
178191
.cells.firstMatch;
179192
}
193+
os_log_error(OS_LOG_DEFAULT, "description before picking image %@", self.app.debugDescription);
180194
if (![aImage waitForExistenceWithTimeout:kElementWaitingTime]) {
181195
os_log_error(OS_LOG_DEFAULT, "%@", self.app.debugDescription);
182196
XCTFail(@"Failed due to not able to find an image with %@ seconds", @(kElementWaitingTime));

packages/image_picker/image_picker/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: image_picker
22
description: Flutter plugin for selecting images from the Android and iOS image
33
library, and taking new pictures with the camera.
44
homepage: https://github.com/flutter/plugins/tree/master/packages/image_picker/image_picker
5-
version: 0.6.7+21
5+
version: 0.6.7+22
66

77
flutter:
88
plugin:

0 commit comments

Comments
 (0)