flutter/packages/flutter_tools/test/commands.shard
Andrew Kolos 8e4f704abc
[CLI tool] in flutter test, consider --flavor when validating the cached asset bundle (#150461)
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.
2024-06-20 17:45:09 +00:00
..
hermetic [CLI tool] in flutter test, consider --flavor when validating the cached asset bundle (#150461) 2024-06-20 17:45:09 +00:00
permeable Update old wiki links (#149544) 2024-06-17 17:26:08 +00:00
README.md

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.