Skip to content

Conversation

@jonahwilliams
Copy link
Contributor

@jonahwilliams jonahwilliams commented Sep 9, 2019

Description

This allows testing code that uses or otherwise requires dart:io, like build_runner and Glob. I used this new feature to write a test, and promptly found a bug in an asset reader that I wrote.

It looks like build_runner relies on an implementation in dart:io to normalize file paths, so this test doesn't currently work on windows.

@fluttergithubbot fluttergithubbot added the tool Affects the "flutter" command-line tool. See also t: labels. label Sep 9, 2019
@codecov
Copy link

codecov bot commented Sep 9, 2019

Codecov Report

Merging #40066 into master will increase coverage by 2.5%.
The diff coverage is 35.93%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master   #40066     +/-   ##
=========================================
+ Coverage   55.61%   58.11%   +2.5%     
=========================================
  Files         194      194             
  Lines       18726    18784     +58     
=========================================
+ Hits        10414    10917    +503     
+ Misses       8312     7867    -445
Flag Coverage Δ
#flutter_tool 58.11% <35.93%> (+2.5%) ⬆️
Impacted Files Coverage Δ
...lib/src/build_runner/web_compilation_delegate.dart 31.57% <100%> (+17.41%) ⬆️
packages/flutter_tools/lib/src/base/io.dart 37.23% <28.07%> (-14.12%) ⬇️
...lutter_tools/lib/src/android/android_workflow.dart 49.05% <0%> (-14.47%) ⬇️
packages/flutter_tools/lib/src/version.dart 90.9% <0%> (-1.92%) ⬇️
packages/flutter_tools/lib/src/asset.dart 82.3% <0%> (-1.65%) ⬇️
...ages/flutter_tools/lib/src/base/user_messages.dart 45.28% <0%> (-0.95%) ⬇️
packages/flutter_tools/lib/src/cache.dart 43.5% <0%> (-0.73%) ⬇️
packages/flutter_tools/lib/src/base/logger.dart 82.12% <0%> (-0.39%) ⬇️
packages/flutter_tools/lib/src/vmservice.dart 37.42% <0%> (+0.15%) ⬆️
packages/flutter_tools/lib/src/devfs.dart 68.47% <0%> (+0.49%) ⬆️
... and 14 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5a3a46a...da7c00b. Read the comment docs.

@codecov
Copy link

codecov bot commented Sep 9, 2019

Codecov Report

❗ No coverage uploaded for pull request base (master@69af9ad). Click here to learn what that means.
The diff coverage is 35.93%.

Impacted file tree graph

@@            Coverage Diff            @@
##             master   #40066   +/-   ##
=========================================
  Coverage          ?   58.34%           
=========================================
  Files             ?      194           
  Lines             ?    18784           
  Branches          ?        0           
=========================================
  Hits              ?    10959           
  Misses            ?     7825           
  Partials          ?        0
Flag Coverage Δ
#flutter_tool 58.34% <35.93%> (?)
Impacted Files Coverage Δ
...lib/src/build_runner/web_compilation_delegate.dart 31.57% <100%> (ø)
packages/flutter_tools/lib/src/base/io.dart 37.23% <28.07%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 69af9ad...fd527c0. Read the comment docs.

WebSocketException,
WebSocketTransformer;

/// An [IOOverrides] that can delegate to [FileSystem] implementation if provided.
Copy link
Member

Choose a reason for hiding this comment

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

It looks like this is only used for testing. Should it go somewhere under test/src?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Moved to test/src/io.dart

AssetId('foobar', 'lib/main.dart'),
]));
}, FlutterIOOverrides(fileSystem: fs));
}), skip: Platform.isWindows);
Copy link
Member

Choose a reason for hiding this comment

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

Can you give an example of the normalization that is expected, or how this fails on Windows? We should try to track this down to avoid similar problems later.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added a comment describing the issue

@jonahwilliams jonahwilliams merged commit c8b3c9b into flutter:master Sep 30, 2019
@jonahwilliams jonahwilliams deleted the io_overrides_api branch September 30, 2019 15:41
Inconnu08 pushed a commit to Inconnu08/flutter that referenced this pull request Sep 30, 2019
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 4, 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