Skip to content

Conversation

jonahwilliams
Copy link
Contributor

@jonahwilliams jonahwilliams commented Jun 24, 2020

Description

These tests will hit the real Cache, failing if the flutter root has been modified

@fluttergithubbot fluttergithubbot added the tool Affects the "flutter" command-line tool. See also t: labels. label Jun 24, 2020

setUp(() {
cache = MockCache();
when(cache.dyLdLibEntry).thenReturn(const MapEntry<String, String>('foo', 'bar'));
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Device discovery created by instantiating DeviceDiscoverers looks up this entry from the cache, will fail if the path does not exist.


setUp(() {
cache = MockCache();
when(cache.dyLdLibEntry).thenReturn(const MapEntry<String, String>('foo', 'bar'));
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Same here

trackWidgetCreation: false,
treeShakeIcons: false,
),
generator: MockResidentCompiler(),
Copy link
Contributor Author

Choose a reason for hiding this comment

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

If the generator is not provided, one is created but that looks up the dartSdk path from the cache.

Copy link
Contributor

Choose a reason for hiding this comment

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

🤦

Copy link
Contributor

Choose a reason for hiding this comment

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

I thought it was hard to write tools tests, but turns out I had no idea...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

the nice thing is ... there are no issues with the tests using testWithoutContext, so at least we are on the right path 👍

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

@flutter-github-sync
Copy link

Started Google testing for this PR

@jonahwilliams jonahwilliams merged commit 5cfcae0 into flutter:master Jun 24, 2020
@jonahwilliams jonahwilliams deleted the fix_devices_test_123 branch June 24, 2020 23:50
mingwandroid pushed a commit to mingwandroid/flutter that referenced this pull request Sep 6, 2020
…tter#60241)

These tests will hit the real Cache, failing if the flutter root has been modified
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 30, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

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.

5 participants