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

[image_picker] Run CocoaPods iOS tests in RunnerUITests target #3663

Merged
merged 1 commit into from
Mar 3, 2021

Conversation

jmagman
Copy link
Member

@jmagman jmagman commented Mar 2, 2021

pod lib lint has been used to run iOS unit tests and the static analyzer. Unfortunately due to Flutter not supporting ARM iOS simulators and the fact that we can't tell the pod command to skip analyzing on that architecture, this has prevented the plugins CI from migrating to Xcode 12 and is blocking Flutter from increasing the Xcode minimum version to 12.

Now that we have a full-fledged xctest_command we can migrate some of the value we were getting from pod lib lint.

Migrate image_picker package to run all the unit tests as part of the RunnerUITests target. Remove the old image_picker_exampleTests in favor of RunnerUITests.

Also swap VALID_ARCHS to the Xcode 12 EXCLUDED_ARCHS generated by the Flutter template as of flutter/flutter#64504

@jmagman jmagman self-assigned this Mar 2, 2021
@google-cla google-cla bot added the cla: yes label Mar 2, 2021
@jmagman jmagman force-pushed the image-picker-tests branch 2 times, most recently from 18c4c30 to 19dc6ca Compare March 2, 2021 21:21
Comment on lines +33 to +35
target 'RunnerUITests' do
inherit! :search_paths
end
Copy link
Member Author

Choose a reason for hiding this comment

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

Checked in the Podfile to inherit search_paths so Flutter linker flags are hooked up. See #3145 for similar fix.

@jmagman jmagman marked this pull request as ready for review March 2, 2021 21:50
@jmagman jmagman requested a review from cyanglaz as a code owner March 2, 2021 21:50
@jmagman jmagman force-pushed the image-picker-tests branch from 19dc6ca to fc5740c Compare March 2, 2021 22:00
Copy link
Contributor

@cyanglaz cyanglaz left a comment

Choose a reason for hiding this comment

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

I remember these are unit tests, should we create a separate target for unit tests?
I didn't know you can combine unit tests and ui tests in a same target.

@jmagman
Copy link
Member Author

jmagman commented Mar 2, 2021

I remember these are unit tests, should we create a separate target for unit tests?
I didn't know you can combine unit tests and ui tests in a same target.

You can run whatever you want in the UI tests as long as the symbols are available. The Runner app symbols aren't available, but the UI tests are linking directly on the plugin framework, and it can test those.

It worked:
https://cirrus-ci.com/task/5631298589949952?command=build#L1930

@jmagman jmagman mentioned this pull request Mar 3, 2021
2 tasks
Copy link
Contributor

@cyanglaz cyanglaz left a comment

Choose a reason for hiding this comment

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

LGTM, maybe we should rename the target to RunnerTest in the future which would be more accurate.

@jmagman
Copy link
Member Author

jmagman commented Mar 3, 2021

LGTM, maybe we should rename the target to RunnerTest in the future which would be more accurate.

Sure, we can use whatever test target name we want once #3667 merges.

@jmagman jmagman merged commit 2eba00a into flutter:master Mar 3, 2021
@jmagman jmagman deleted the image-picker-tests branch March 3, 2021 01:48
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Mar 3, 2021
NickalasB added a commit to NickalasB/plugins that referenced this pull request Mar 3, 2021
* master:
  Adopt Xcode 12 for podspec lints (flutter#3653)
  Run static analyzer during xctest (flutter#3667)
  [google_maps_flutter_web] update min flutter sdk version to 1.20.0 (flutter#3662)
  [image_picker] Run CocoaPods iOS tests in RunnerUITests target (flutter#3663)
  [webview_flutter] Run CocoaPods iOS tests in RunnerUITests target (flutter#3664)
  [device_info] Enable NNBD for unit test (flutter#3658)
  remove unused plugin (flutter#3661)
  [android_intent] move unit test to nullsafety (flutter#3659)
  [url_launcher] Migrate unit tests to NNBD (flutter#3657)
  [share] Migrate unit tests to null-safety. (flutter#3660)
  [connectivity_for_web] Migration to null-safety. (flutter#3652)
  [camera] Stable release for null safety. (flutter#3641)
  [in_app_purchase] fix plugin version (flutter#3654)
  Move plugin tool tests over (flutter#3606)
  [in_app_purchase] migrate playing billing library to v3 (flutter#3636)
  Update plugin_platform_interface min version (flutter#3650)

# Conflicts:
#	packages/webview_flutter/CHANGELOG.md
#	packages/webview_flutter/example/ios/Runner.xcodeproj/project.pbxproj
@jmagman jmagman mentioned this pull request Mar 9, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants