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

Run static analyzer during xctest #3667

Merged
merged 1 commit into from
Mar 3, 2021
Merged

Conversation

jmagman
Copy link
Member

@jmagman jmagman commented Mar 3, 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 the static analyzer from pod lib lint to the custom test runner.

  1. Run static analyzer as part of xctest. Automatically skip test and just analyze if the unit tests aren't set up. Remove --target from xctest, always just use the test target associated with the Runner app.
  2. Stop analyzing in the lint_podspecs_command.

Unblocks #3653 and therefore flutter/flutter#77025.

Fixes flutter/flutter#68419

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 assuming all test targets run

Comment on lines +120 to +121
'-scheme',
'Runner',
Copy link
Contributor

Choose a reason for hiding this comment

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

I didn't know this, making the scheme to be the app target runs all the test targets?

Copy link
Member Author

Choose a reason for hiding this comment

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

No, it runs whatever tests are hooked up in the specified scheme. So in this case, xcodebuild test -scheme Runner will run the tests set up in the Runner scheme.
Screen Shot 2021-03-02 at 5 52 00 PM

@jmagman jmagman added the waiting for tree to go green (Use "autosubmit") This PR is approved and tested, but waiting for the tree to be green to land. label Mar 3, 2021
@fluttergithubbot
Copy link

This pull request is not suitable for automatic merging in its current state.

  • The status or check suite submit-queue has failed. Please fix the issues identified (or deflake) before re-applying this label.

@fluttergithubbot fluttergithubbot removed the waiting for tree to go green (Use "autosubmit") This PR is approved and tested, but waiting for the tree to be green to land. label Mar 3, 2021
@jmagman jmagman merged commit 60d85fd into flutter:master Mar 3, 2021
@jmagman jmagman deleted the xctest-analyzer branch March 3, 2021 03:27
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.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improve the xctest command so it looks for target and destination automatically
3 participants