Skip to content

Conversation

jonahwilliams
Copy link
Contributor

Description

Fixes additional bugs uncovered by tester, style fixes to prevent suggested imports.

@fluttergithubbot fluttergithubbot added the tool Affects the "flutter" command-line tool. See also t: labels. label Jun 23, 2020
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))) {
Copy link
Contributor Author

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()) {
Copy link
Contributor Author

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(),
Copy link
Contributor Author

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 {
Copy link
Contributor Author

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) {
Copy link
Contributor Author

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(
Copy link
Contributor Author

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

@jonahwilliams jonahwilliams requested a review from jmagman June 24, 2020 00:13
Copy link
Member

@jmagman jmagman left a comment

Choose a reason for hiding this comment

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

LGTM

@jonahwilliams jonahwilliams merged commit dd49e57 into flutter:master Jun 24, 2020
@jonahwilliams jonahwilliams deleted the more_tester_work branch June 24, 2020 00:58
mingwandroid pushed a commit to mingwandroid/flutter that referenced this pull request Sep 6, 2020
Fixes additional bugs uncovered by tester, style fixes to prevent suggested imports.
@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.

4 participants