Skip to content

Inject Usage dependency into FallbackDiscovery and BuildEvent #53443

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
merged 2 commits into from
Apr 2, 2020

Conversation

jmagman
Copy link
Member

@jmagman jmagman commented Mar 27, 2020

Description

Inject Usage into FallbackDiscovery and BuildEvent.
Convert fallback_discovery_test.dart to testWithoutContext

Related Issues

#47161

Checklist

  • I read the [Contributor Guide] and followed the process outlined there for submitting PRs.
  • I signed the [CLA].
  • I read and followed the [Flutter Style Guide], including [Features we expect every widget to implement].
  • I read the [Tree Hygiene] wiki page, which explains my responsibilities.
  • I updated/added relevant documentation (doc comments with ///).
  • All existing and new tests are passing.
  • The analyzer (flutter analyze --flutter-repo) does not report any problems on my PR.
  • I am willing to follow-up on review comments in a timely manner.

Breaking Change

  • No, no existing tests failed, so this is not a breaking change.
  • Yes, this is a breaking change. If not, delete the remainder of this section.

@jmagman jmagman added c: contributor-productivity Team-specific productivity, code health, technical debt. tool Affects the "flutter" command-line tool. See also t: labels. labels Mar 27, 2020
@jmagman jmagman self-assigned this Mar 27, 2020
@@ -132,16 +132,14 @@ void main() {
),
);

await diagnoseXcodeBuildFailure(buildResult);
await diagnoseXcodeBuildFailure(buildResult, mockUsage, logger);
Copy link
Member Author

Choose a reason for hiding this comment

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

These tests still hit the context.

Future<VmService> Function(String wsUri, {Log log}) vmServiceConnectUri =
vm_service_io.vmServiceConnectUri,
}) : _logger = logger,
_mDnsObservatoryDiscovery = mDnsObservatoryDiscovery,
_portForwarder = portForwarder,
_protocolDiscovery = protocolDiscovery,
_flutterUsage = flutterUsage,
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
_flutterUsage = flutterUsage,
_flutterUsage = flutterUsage,

@@ -48,6 +48,7 @@ void main() {
platform: platform,
processManager: processManager,
terminal: terminal,
usage: null,
Copy link
Member

Choose a reason for hiding this comment

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

In the future we'll likely want to make these non-nullable. Consider creating a FlutterUsage.test() which can be created at low cost to avoid explicitly passing null

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.

other than Jonah's suggestions, LGTM

@christopherfujino
Copy link
Contributor

Oh, and an analyzer error:

The following file import a test directly. Test utilities should be in their own file.
/tmp/flutter sdk/packages/flutter_tools/test/general.shard/ios/fallback_discovery_test.dart

Copy link
Member

@jonahwilliams jonahwilliams left a comment

Choose a reason for hiding this comment

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

LGTM

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

@jmagman jmagman merged commit 77ea848 into flutter:master Apr 2, 2020
@jmagman jmagman deleted the usage-injection branch April 2, 2020 17:57
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 31, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
c: contributor-productivity Team-specific productivity, code health, technical debt. tool Affects the "flutter" command-line tool. See also t: labels.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants