-
Andrew Kolos authored
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](https://github.com/flutter/flutter/blob/4cd0a3252d2b45e243714b3ce93c5b2313bce671/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: https://github.com/flutter/flutter/blob/f2745e97d53c6a29c7d40003dfaa4fc4c688cdd2/packages/flutter_tools/test/general.shard/asset_bundle_test.dart#L35-L40 https://github.com/flutter/flutter/blob/f2745e97d53c6a29c7d40003dfaa4fc4c688cdd2/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.
Name |
Last commit
|
Last update |
---|---|---|
.. | ||
android_preview_integration.shard | ||
commands.shard | ||
data | ||
general.shard | ||
host_cross_arch.shard | ||
integration.shard | ||
src | ||
web.shard |