
Fixes https://github.com/flutter/flutter/issues/150296
**Context.** `flutter test` has its own code path for writing flutter app [assets](https://docs.flutter.dev/ui/assets/assets-and-images). https://github.com/flutter/flutter/pull/132985 introduced [flavor-conditional asset bundling ](https://docs.flutter.dev/deployment/flavors#conditionally-bundling-assets-based-on-flavor), which lets users control which assets get bundled based on `--flavor`. `--flavor` is supported in `flutter test`.
**Bug and fix.** `--flavor` isn't considered when deciding whether we need to rebuild this asset bundle:
5e448f4ce5/packages/flutter_tools/lib/src/commands/test.dart (L709)
This PR address this by writing the value of `--flavor` to a file in the build directory and checking that when validating the cached asset bundle.
This directory contains tests for specific flutter
commands.
Tests that are self-contained unit tests should go in hermetic/
.
Tests that are more end-to-end, e.g. that involve actually running
subprocesses, should go in permeable/
.
The ../../tool/coverage_tool.dart
script (which is used to collect
coverage for the tool) runs only the tests in the hermetic
directory
when collecting coverage.