Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update IntegrationTestPlugin.m #116539

Conversation

barringb
Copy link

@barringb barringb commented Dec 5, 2022

The integration_test native plugin is not being correctly registered on iOS when running tests via flutter drive. Adding an
IntegrationTestPlugin instance to registerWithRegistrar method in IntegrationTestPlugin.m.

This plugin instance was previously removed before integration_test was migrated from e2e to prevent an error where the e2e plugin would not exit testing. This does not appear to be an issue with integration_test and my tests exit properly regardless of run with flutter drive or through XCode.

List which issues are fixed by this PR. You must list at least one issue.
#91668

If you had to change anything in the flutter/tests repo, include a link to the migration guide as per the breaking change policy.

Pre-launch Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I read the Tree Hygiene wiki page, which explains my responsibilities.
  • I read and followed the Flutter Style Guide, including Features we expect every widget to implement.
  • I signed the CLA.
  • I listed at least one issue that this PR fixes in the description above.
  • I updated/added relevant documentation (doc comments with ///).
  • I added new tests to check the change I am making, or this PR is test-exempt.
  • All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel on Discord.

@flutter-dashboard flutter-dashboard bot added the f: integration_test The flutter/packages/integration_test plugin label Dec 5, 2022
@flutter-dashboard
Copy link

It looks like this pull request may not have tests. Please make sure to add tests before merging. If you need an exemption to this rule, contact Hixie on the #hackers channel in Chat (don't just cc him here, he won't see it! He's on Discord!).

If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix?

Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing.

@jmagman jmagman added the framework flutter/packages/flutter repository. See also f: labels. label Feb 22, 2023
@goderbauer goderbauer added the platform-ios iOS applications specifically label Feb 28, 2023
Copy link
Contributor

@pdblasi-google pdblasi-google left a comment

Choose a reason for hiding this comment

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

LGTM

@barringb Thanks for the PR and the great write-up! The links and history provided some much needed context, so I really appreciate it!

Copy link
Member

@jmagman jmagman left a comment

Choose a reason for hiding this comment

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

This does not appear to be an issue with integration_test and my tests exit properly regardless of run with flutter drive or through XCode.

You tested this with static libraries (the default with an Objective-C project)?

integration_test was migrated from e2e to prevent an error where the e2e plugin would not exit testing.

I'm not sure how that would have fixed this issue. I need to check out this change and see if I can reproduce #48601

@jmagman
Copy link
Member

jmagman commented Mar 3, 2023

I tried to get the hang to reproduce and couldn't, details in #91668 (comment)

Instead of this one line change, let's actually remove the entire workaround from flutter/plugins#2465. Meaning remove the exposed -setupChannels: method, and change the +registerWithRegistrar to its original

+ (void)registerWithRegistrar:(NSObject<FlutterPluginRegistrar> *)registrar {
  FlutterMethodChannel *channel = [FlutterMethodChannel methodChannelWithName:kIntegrationTestPluginChannel
                                                              binaryMessenger:registrar.messenger];
  [registrar addMethodCallDelegate:[self instance] channel:channel];
}

Let me know if you would prefer I close this and open my own PR instead.

Copy link
Member

@jmagman jmagman left a comment

Choose a reason for hiding this comment

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

Requesting -setupChannels: removal.

@goderbauer
Copy link
Member

(Triage) @barringb Do you still have plans to follow-up on the feedback given above? Thanks!

@jmagman
Copy link
Member

jmagman commented Mar 30, 2023

I wound up reverting flutter/plugins#2465 in #123729, including removing the now-dead code.

@barringb Thank you for your contribution and kicking off this investigation!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
f: integration_test The flutter/packages/integration_test plugin framework flutter/packages/flutter repository. See also f: labels. platform-ios iOS applications specifically
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants