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

Skip to content

Fix custom-device default forwardPortSuccessRegex #97719

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

Merged

Conversation

mbriand
Copy link
Contributor

@mbriand mbriand commented Feb 3, 2022

This PR tries to make port forwarding verification on custom devices more reliable, by not relying on behavior that may change across different systems.

Previously we were looking for Linux word in target connection banner. Now we ask the remote to print a fixed string ('Port forwarding success`) and look for this given string to ensure the connection was successful.

Fix #97641

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.

@flutter-dashboard flutter-dashboard bot added the tool Affects the "flutter" command-line tool. See also t: labels. label Feb 3, 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.

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.

Copy link
Contributor

@christopherfujino christopherfujino left a comment

Choose a reason for hiding this comment

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

I think this would need a test before we can merge.

@mbriand
Copy link
Contributor Author

mbriand commented Feb 23, 2022

Sorry, I was not very active on this PR.

So yes, I would be happy to add some tests here. Actually my modification made some tests to fail, but these tests were removed in commit 87fe3fe (#98299), as they were failing for another issue, that I believe is actually a bug.

I managed to fix this bug and make the test pass, would you mind if I import back these tests ? I'm pushing these modifications, just to detail what I am talking about.

@mbriand mbriand force-pushed the mbria/fix_portforward_regex branch from 1796496 to 840fe15 Compare February 23, 2022 17:08
@christopherfujino
Copy link
Contributor

Sorry, I was not very active on this PR.

So yes, I would be happy to add some tests here. Actually my modification made some tests to fail, but these tests were removed in commit 87fe3fe (#98299), as they were failing for another issue, that I believe is actually a bug.

I managed to fix this bug and make the test pass, would you mind if I import back these tests ? I'm pushing these modifications, just to detail what I am talking about.

Oh nice! This is great.

@christopherfujino
Copy link
Contributor

The analysis failure was fixed upstream, a rebase should fix

Copy link
Contributor

@christopherfujino christopherfujino left a comment

Choose a reason for hiding this comment

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

LGTM

Having an empty list as postBuildCommand value will trigger an error on
JSON parsing: make sure to save a null instead.
@mbriand mbriand force-pushed the mbria/fix_portforward_regex branch from 9b80bd4 to 0cb9761 Compare February 25, 2022 07:58
@mbriand mbriand force-pushed the mbria/fix_portforward_regex branch from c6402dc to 394dfce Compare February 25, 2022 08:55
@mbriand
Copy link
Contributor Author

mbriand commented Feb 25, 2022

Sorry, I still have an issue with the "Linux analyze" test. It complains that I have to "Avoid redundant argument values", but if I remove the postBuildCommand parameter, it complains that "The parameter 'postBuildCommand' is required".

   info � Avoid redundant argument values � packages/flutter_tools/test/commands.shard/hermetic/custom_devices_test.dart:557:33 � avoid_redundant_argument_values
   info � Avoid redundant argument values � packages/flutter_tools/test/commands.shard/hermetic/custom_devices_test.dart:647:33 � avoid_redundant_argument_values
   info � Avoid redundant argument values � packages/flutter_tools/test/commands.shard/hermetic/custom_devices_test.dart:737:33 � avoid_redundant_argument_values
   info � Avoid redundant argument values � packages/flutter_tools/test/commands.shard/hermetic/custom_devices_test.dart:831:33 � avoid_redundant_argument_values
   info � Avoid redundant argument values � packages/flutter_tools/test/commands.shard/hermetic/custom_devices_test.dart:911:33 � avoid_redundant_argument_values
   info � Avoid redundant argument values � packages/flutter_tools/test/commands.shard/hermetic/custom_devices_test.dart:1236:33 � avoid_redundant_argument_values
warning � The parameter 'postBuildCommand' is required � packages/flutter_tools/test/commands.shard/hermetic/custom_devices_test.dart:546:13 � missing_required_param
warning � The parameter 'postBuildCommand' is required � packages/flutter_tools/test/commands.shard/hermetic/custom_devices_test.dart:635:13 � missing_required_param
warning � The parameter 'postBuildCommand' is required � packages/flutter_tools/test/commands.shard/hermetic/custom_devices_test.dart:723:13 � missing_required_param
warning � The parameter 'postBuildCommand' is required � packages/flutter_tools/test/commands.shard/hermetic/custom_devices_test.dart:817:19 � missing_required_param
warning � The parameter 'postBuildCommand' is required � packages/flutter_tools/test/commands.shard/hermetic/custom_devices_test.dart:896:13 � missing_required_param
warning � The parameter 'postBuildCommand' is required � packages/flutter_tools/test/commands.shard/hermetic/custom_devices_test.dart:1219:13 � missing_required_param

So I explicitly added // ignore: avoid_redundant_argument_values. Is that the right way to do it ?

@fluttergithubbot
Copy link
Contributor

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

  • Please get at least one approved review if you are already a member or two member reviews if you are not a member before re-applying this label. Reviewers: If you left a comment approving, please use the "approve" review action instead.

@christopherfujino
Copy link
Contributor

@Jasguerrero can you review this one too?

Copy link
Contributor

@Jasguerrero Jasguerrero left a comment

Choose a reason for hiding this comment

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

LGTM

engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Mar 11, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Mar 11, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Mar 11, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Mar 11, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Mar 11, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Mar 11, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Mar 11, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Mar 11, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Mar 12, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Mar 14, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Mar 14, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Mar 14, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Mar 14, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Mar 14, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Mar 14, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Mar 14, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Mar 14, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Mar 14, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Mar 14, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Mar 14, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Mar 14, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Mar 14, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Mar 14, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Mar 14, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Mar 15, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Mar 15, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Mar 15, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Mar 15, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Mar 15, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Mar 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tool Affects the "flutter" command-line tool. See also t: labels.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[custom-devices] default "forwardPortSuccessRegex" value does not match
4 participants