flutter/packages/flutter_tools/test/commands.shard
Andrew Kolos 21144362f8
Move platform-specific log-reading implementation details from ResidentRunner/FlutterDevice to DeviceLogReader implementations (#156181)
Cleans up https://github.com/flutter/flutter/pull/155800. In summary, `ResidentRunner`/`FlutterDevice` have branching behavior around logging that depends on the type of `DeviceLogReader` on the `FlutterDevice` instance.  Let's instead move this behavior to the `DeviceLogReader` implementations.

My apologies for the large diff. Much of this is a refactor that was a bit too difficult to separate into its own commits. 

Here are the main two changes

* Replaces the mutable `connectedVmService` field on the `DeviceLogReader` class with a new method `provideVmService`. This serves largely the same purpose as the mutable field, but it allows for asynchronous code. This is where we put the logic that used to exist in `FlutterDevice.tryInitLogReader`.
* Removes the `tryInitLogReader` method from `FlutterDevice`. This method served to set the `appPid` field on the `FlutterDevice`'s `DeviceLogReader` instance. This was only used in the case of Android to filter out logs unrelated to the flutter app coming from the device, so we can move this logic to `AdbLogReader`'s implementation of `provideVmService`.
2024-11-14 21:29:30 +00:00
..
hermetic Move platform-specific log-reading implementation details from ResidentRunner/FlutterDevice to DeviceLogReader implementations (#156181) 2024-11-14 21:29:30 +00:00
permeable Move explicit package dependencies to a feature flag (#158016) 2024-11-13 18:33:34 -08:00
README.md Move commands into their own shard (#39140) 2019-10-02 12:46:51 -07:00

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.