-
Notifications
You must be signed in to change notification settings - Fork 29.3k
[flutter_tools] more test fixes #60144
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
Conversation
final Uri potential = uri.resolve(request.url.path); | ||
if (potential == null || !globals.fs.isFileSync(potential.toFilePath())) { | ||
if (potential == null || !globals.fs.isFileSync( | ||
potential.toFilePath(windows: globals.platform.isWindows))) { |
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.
missing windows check, was creating this as a windows style file path even if configured paths were possix style
// much as possible in an effort to re-use as many packages as | ||
// possible. | ||
globals.fsUtils.ensureDirectoryExists(testFilePath); | ||
if (!testCache.parent.existsSync()) { |
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.
This was calling the real fsUtils in the test. Rather than inject it I replaced this with roughly equivalent code. I'm not sure how useful ensureDirectoryExists actually is.
ProcessManager: () => mockProcessManager, | ||
OutputPreferences: () => OutputPreferences(showColor: false), | ||
Platform: kNoColorTerminalPlatform, | ||
Artifacts: () => Artifacts.test(), |
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.
This was calling real artifacts, falling if they did not exist
group('Project', () { | ||
group('construction', () { | ||
testInMemory('fails on null directory', () async { | ||
_testInMemory('fails on null directory', () async { |
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.
Renamed this to stop my IDE from autosuggesting it when i type test
class MockOperatingSystemUtils extends Mock implements OperatingSystemUtils {} | ||
|
||
Future<Chromium> testLaunchChrome(String userDataDir, FakeProcessManager processManager, ChromiumLauncher chromeLauncher) { | ||
Future<Chromium> _testLaunchChrome(String userDataDir, FakeProcessManager processManager, ChromiumLauncher chromeLauncher) { |
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.
Similar to above rename
0x0A, 0x2D, 0xB4, 0x00, 0x00, 0x00, 0x00, 0x49, 0x45, 0x4E, 0x44, 0xAE, | ||
]; | ||
|
||
final Platform platform = FakePlatform( |
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 switched this to only use a linux file system/path to make it more obvious where we were failing to correctly configure things. I.e., the windows path in the toFilePath on URI
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
Fixes additional bugs uncovered by tester, style fixes to prevent suggested imports.
Description
Fixes additional bugs uncovered by tester, style fixes to prevent suggested imports.