flutter/packages/flutter_tools/test
Andrew Kolos 5757500931
Make test file systems/platforms used in asset_bundle_test.dart less dependent on the host platform (#141657)
Part of work on https://github.com/flutter/flutter/pull/141214. See [this discussion](https://github.com/flutter/flutter/pull/141214#discussion_r1446727495) for the inspiration for this PR.

## Issue
Many tests in [packages/flutter_tools/test/general.shard/asset_bundle_test.dart](4cd0a3252d/packages/flutter_tools/test/general.shard/asset_bundle_test.dart) aren't hermetic. When setting up fake `FileSystem` and `Platform` objects, the host OS is referenced:

f2745e97d5/packages/flutter_tools/test/general.shard/asset_bundle_test.dart (L35-L40)

f2745e97d5/packages/flutter_tools/test/general.shard/asset_bundle_test.dart (L43)

To improve hermeticity here, we could instead run each once _per_ valid combination of file system style and platform. However, it is unclear if these tests even depend on the file system style (integration tests should catch most cases where this might matter). As a result, I think it's sufficient to improve hermeticity by always assuming a Linux environment, which is generally our default (as `MemoryFileSystem` does, and most of our fakes of `Platform` do by default).

In general, if a test needs to run other kinds of environments, it should make this clear, ideally through the test name.
2024-01-17 21:23:01 +00:00
..
android_preview_integration.shard Allow plugins to use compileSdkPreview (#131901) 2023-12-12 20:06:04 +00:00
commands.shard Fix the --empty flag to not try working with non-app templates (#141632) 2024-01-17 16:51:03 +00:00
data make asset_test.dart tests not dependent on context (#141331) 2024-01-11 18:08:07 +00:00
general.shard Make test file systems/platforms used in asset_bundle_test.dart less dependent on the host platform (#141657) 2024-01-17 21:23:01 +00:00
host_cross_arch.shard Remove deprecated bitcode stripping from tooling (#140903) 2024-01-03 23:15:23 +00:00
integration.shard Native assets: roll deps (#141684) 2024-01-17 21:20:36 +00:00
src in flutter run, throw tool exit when --flavor is provided but is not supported on the target device (#139045) 2024-01-05 21:47:58 +00:00
web.shard [flutter_tool] Delete skipped tests (#136364) 2023-10-11 10:24:14 -07:00