Thanks to visit codestin.com
Credit goes to github.com

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

[ci][image_picker]enable xcode 12/iOS 14 for all tasks except lint #3304

Merged
merged 41 commits into from
Jan 23, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
12551e3
xcode 12 for tasks
Dec 4, 2020
64f2b50
update waiting time
Dec 4, 2020
28f9f7b
update test
Dec 7, 2020
f4c949a
try fix image picker test
Dec 7, 2020
de0286a
remove unnecessary tasks
Dec 7, 2020
bd0200a
try fix image picker test again
Dec 7, 2020
927d250
try fix again
Dec 7, 2020
37616e7
try xcode 12.2
Dec 7, 2020
f5b9269
xcode 12.1
Dec 7, 2020
e1d8df4
ios 14.2 simulator
Dec 7, 2020
2254685
simulator 14.2
Dec 8, 2020
d84c950
fix image picker test
Dec 8, 2020
75613a1
enable share
Dec 8, 2020
0b7c246
try xcode 12.1.1
Dec 8, 2020
4754aeb
try xcode 12.2
Dec 8, 2020
e90ed2c
rest to xcode 12.1
Dec 8, 2020
30ef592
draft
Dec 10, 2020
bee2c20
merge master
Dec 10, 2020
f7c4701
ios 14.1
Dec 11, 2020
5f71bca
xcode 12.0
Dec 11, 2020
bca25b5
xcode 12.1
Dec 14, 2020
9ab3345
14.2
Dec 14, 2020
62617e0
test run on 14.2
Dec 14, 2020
882cdd2
merge master
Jan 20, 2021
2c45fc2
12.0
Jan 20, 2021
04d3c38
iphone x
Jan 21, 2021
9732873
big sur
Jan 21, 2021
9bc4125
fix image name
Jan 21, 2021
b386dd6
fixed simulator version
Jan 21, 2021
16d163b
skip drive for testing
Jan 21, 2021
244ed61
try experimental
Jan 21, 2021
c916911
add log to xctest
Jan 22, 2021
e4ccde2
test picking image first
Jan 22, 2021
41eace9
tap self to ensure popup
Jan 22, 2021
0a00532
try separate tests
Jan 22, 2021
72f96af
fix capturing strong reference
Jan 22, 2021
f690f2d
add teardown to terminate the app
Jan 22, 2021
5c7a769
remove experimental flag
Jan 22, 2021
580af84
uncommment tasks
Jan 22, 2021
d31e430
review
Jan 23, 2021
f26127b
typo
Jan 23, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 36 additions & 14 deletions .cirrus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ task:
env:
INTEGRATION_TEST_PATH: "./packages/integration_test"
upgrade_script:
- sudo gem install cocoapods
- flutter channel stable
- flutter upgrade
- flutter channel master
Expand All @@ -134,13 +135,14 @@ task:
- xvfb-run ./script/incremental_build.sh drive-examples --linux

task:
# Xcode 11 task
# TODO(cyanglaz): merge Xcode 11 task to Xcode 12 task when all the matrix can be run in Xcode 12.
# don't run on release tags since it creates O(n^2) tasks where n is the number of plugins
only_if: $CIRRUS_TAG == ''
use_compute_credits: $CIRRUS_USER_COLLABORATOR == 'true'
osx_instance:
image: catalina-xcode-11.3.1-flutter
upgrade_script:
- sudo gem install cocoapods
Copy link
Member

Choose a reason for hiding this comment

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

Should we keep this to keep CocoaPods up to date?

- flutter channel stable
- flutter upgrade
- flutter channel master
Expand All @@ -151,17 +153,6 @@ task:
- xcrun simctl list
- xcrun simctl create Flutter-iPhone com.apple.CoreSimulator.SimDeviceType.iPhone-X com.apple.CoreSimulator.SimRuntime.iOS-13-3 | xargs xcrun simctl boot
matrix:
- name: build_all_plugins_ipa
env:
matrix:
CHANNEL: "master"
CHANNEL: "stable"
script:
# TODO(jackson): Allow web plugins once supported on stable
# https://github.com/flutter/flutter/issues/42864
- if [[ "$CHANNEL" -eq "stable" ]]; then find . | grep _web$ | xargs rm -rf; fi
- flutter channel $CHANNEL
- ./script/build_all_plugins_app.sh ios --no-codesign
- name: lint_darwin_plugins
env:
matrix:
Expand All @@ -173,6 +164,37 @@ task:
# Skip the dummy podspecs used to placate the tool.
- find . -name "*_web*.podspec" -o -name "*_mac*.podspec" | xargs rm
- ./script/incremental_build.sh podspecs

task:
# Xcode 12 task
# don't run on release tags since it creates O(n^2) tasks where n is the number of plugins
only_if: $CIRRUS_TAG == ''
use_compute_credits: $CIRRUS_USER_COLLABORATOR == 'true'
osx_instance:
image: big-sur-xcode-12.3
upgrade_script:
- sudo gem install cocoapods
- flutter channel stable
- flutter upgrade
- flutter channel master
- flutter upgrade
- git fetch origin master
activate_script: pub global activate flutter_plugin_tools
create_simulator_script:
- xcrun simctl list
- xcrun simctl create Flutter-iPhone com.apple.CoreSimulator.SimDeviceType.iPhone-11 com.apple.CoreSimulator.SimRuntime.iOS-14-3 | xargs xcrun simctl boot
matrix:
- name: build_all_plugins_ipa
env:
matrix:
CHANNEL: "master"
CHANNEL: "stable"
script:
# TODO(jackson): Allow web plugins once supported on stable
# https://github.com/flutter/flutter/issues/42864
- if [[ "$CHANNEL" -eq "stable" ]]; then find . | grep _web$ | xargs rm -rf; fi
- flutter channel $CHANNEL
- ./script/build_all_plugins_app.sh ios --no-codesign
- name: build-ipas+drive-examples
env:
PATH: $PATH:/usr/local/bin
Expand All @@ -193,13 +215,13 @@ task:
- flutter channel $CHANNEL
- ./script/incremental_build.sh build-examples --ipa
- ./script/incremental_build.sh drive-examples
- ./script/incremental_build.sh xctest --target RunnerUITests --skip $PLUGINS_TO_SKIP_XCTESTS
- ./script/incremental_build.sh xctest --target RunnerUITests --skip $PLUGINS_TO_SKIP_XCTESTS --ios-destination "platform=iOS Simulator,name=iPhone 11,OS=14.3"
task:
# don't run on release tags since it creates O(n^2) tasks where n is the number of plugins
only_if: $CIRRUS_TAG == ''
use_compute_credits: $CIRRUS_USER_COLLABORATOR == 'true'
osx_instance:
image: catalina-xcode-11.3.1-flutter
image: big-sur-xcode-12.3
setup_script:
- flutter config --enable-macos-desktop
upgrade_script:
Expand Down
4 changes: 4 additions & 0 deletions packages/image_picker/image_picker/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 0.6.7+22

* iOS: update XCUITests to separate each test session.

## 0.6.7+21

* Update the example app: remove the deprecated `RaisedButton` and `FlatButton` widgets.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ @interface ImagePickerFromGalleryUITests : XCTestCase
@implementation ImagePickerFromGalleryUITests

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

self.continueAfterFailure = NO;
Expand All @@ -31,7 +32,7 @@ - (void)setUp {
if (![allPhotoPermission waitForExistenceWithTimeout:
kElementWaitingTime]) {
os_log_error(OS_LOG_DEFAULT, "%@",
self.app.debugDescription);
weakSelf.app.debugDescription);
XCTFail(@"Failed due to not able to find "
@"allPhotoPermission button with %@ seconds",
@(kElementWaitingTime));
Expand All @@ -42,7 +43,7 @@ - (void)setUp {
if (![ok waitForExistenceWithTimeout:
kElementWaitingTime]) {
os_log_error(OS_LOG_DEFAULT, "%@",
self.app.debugDescription);
weakSelf.app.debugDescription);
XCTFail(@"Failed due to not able to find ok button "
@"with %@ seconds",
@(kElementWaitingTime));
Expand All @@ -53,11 +54,19 @@ - (void)setUp {
}];
}

- (void)tearDown {
[super tearDown];
[self.app terminate];
Copy link
Member

Choose a reason for hiding this comment

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

-[super testDown];

}

- (void)testPickingFromGallery {
[self launchPickerAndCancel];
[self launchPickerAndPick];
}

- (void)testCancel {
[self launchPickerAndCancel];
}

- (void)launchPickerAndCancel {
// Find and tap on the pick from gallery button.
NSPredicate* predicateToFindImageFromGalleryButton =
Expand Down Expand Up @@ -160,6 +169,10 @@ - (void)launchPickerAndPick {
XCTAssertTrue(pickButton.exists);
[pickButton tap];

// There is a known bug where the permission popups interruption won't get fired until a tap
// happened in the app. We expect a permission popup so we do a tap here.
[self.app tap];

// Find an image and tap on it. (IOS 14 UI, images are showing directly)
XCUIElement* aImage;
if (@available(iOS 14, *)) {
Expand All @@ -177,6 +190,7 @@ - (void)launchPickerAndPick {
identifier:@"PhotosGridView"]
.cells.firstMatch;
}
os_log_error(OS_LOG_DEFAULT, "description before picking image %@", self.app.debugDescription);
if (![aImage waitForExistenceWithTimeout:kElementWaitingTime]) {
os_log_error(OS_LOG_DEFAULT, "%@", self.app.debugDescription);
XCTFail(@"Failed due to not able to find an image with %@ seconds", @(kElementWaitingTime));
Expand Down
2 changes: 1 addition & 1 deletion packages/image_picker/image_picker/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: image_picker
description: Flutter plugin for selecting images from the Android and iOS image
library, and taking new pictures with the camera.
homepage: https://github.com/flutter/plugins/tree/master/packages/image_picker/image_picker
version: 0.6.7+21
version: 0.6.7+22

flutter:
plugin:
Expand Down