-
Notifications
You must be signed in to change notification settings - Fork 29.3k
[flutter_tools] fix tests that depend on correct cache existance #60241
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
[flutter_tools] fix tests that depend on correct cache existance #60241
Conversation
|
||
setUp(() { | ||
cache = MockCache(); | ||
when(cache.dyLdLibEntry).thenReturn(const MapEntry<String, String>('foo', 'bar')); |
There was a problem hiding this comment.
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')); |
There was a problem hiding this comment.
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(), |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤦
There was a problem hiding this comment.
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...
There was a problem hiding this comment.
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 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Started Google testing for this PR |
…tter#60241) These tests will hit the real Cache, failing if the flutter root has been modified
Description
These tests will hit the real Cache, failing if the flutter root has been modified