flutter/packages/flutter_tools/test/general.shard
auto-submit[bot] 8df62188f0
Reverts "Use coverage.collect's coverableLineCache param to speed up coverage" (#137121)
Reverts flutter/flutter#136851
Initiated by: CaseyHillers
This change reverts the following previous change:
Original Description:
One of the reasons gathering coverage information is expensive is that we have to force compile every function in the libraries we're interested in. Without this, functions that haven't been invoked (so haven't been compiled) won't have any line number information, so the coverage tool doesn't know which lines to add to the list of misses. In flutter's case, the test infra spawns many VMs, and each of these needs to recompile all those libraries.

To fix this, we need a way of skipping force compilation for libraries we've already seen in previous tests, without losing the information about which lines in each library are coverable. So I [added](https://github.com/dart-lang/coverage/pull/466) the `coverableLineCache` to `coverage.collect` in package:coverage v1.7.0. This cache starts out empty, but fills up with lists of all the lines that are coverable for every library as coverage is gathered. package:coverage can then tell the VM not to force compile any libraries in this cache (using `getSourceReport`'s `librariesAlreadyCompiled` param). So the first test suite will still have to compile everything, but subsequent test suites will be much faster.

This speeds up coverage collection significantly, for large test suites:

| Running flutter/packages/flutter tests... | Time | Overhead |
| --- | --- | --- |
| without coverage | 8:53 | - |
| with coverage | 20:25 | 130% |
| with `coverableLineCache` | 12:21 | 40% |

Bug: https://github.com/flutter/flutter/issues/100751
2023-10-24 02:38:27 +00:00
..
android Add --trace-to-file option to flutter run (#135713) 2023-10-12 13:23:52 -04:00
base Flutter preview device (#135639) 2023-10-18 00:27:54 +00:00
build_system Default NativeAssets Darwin and IOS target archs if missing (#136948) 2023-10-20 09:28:52 -07:00
commands Flutter preview device (#135639) 2023-10-18 00:27:54 +00:00
custom_devices Don't build native assets in flutter build bundle (#136641) 2023-10-18 11:57:44 +00:00
dap Upgrade framework pub dependencies, roll engine with rolled dart sdk (#130163) 2023-07-07 13:55:35 -07:00
dart Fix dart pub cache clean command on pub.dart (#128171) 2023-06-15 20:38:04 +00:00
drive Fix: use --web-launch-url and --web-hostname arguments in flutter drive (#131763) 2023-08-10 20:53:08 +00:00
fuchsia Update collection-fors to prefer final (as per updated prefer_final_in_for_each) (#127511) 2023-05-26 23:34:36 +00:00
intellij [flutter_tools] Fix TypeError when a FileSystemException happens during flutter doctor (#133373) 2023-09-05 18:00:07 +00:00
ios Add --trace-to-file option to flutter run (#135713) 2023-10-12 13:23:52 -04:00
linux Native assets support for Windows (#134203) 2023-09-27 12:22:58 +00:00
macos Native assets support for Windows (#134203) 2023-09-27 12:22:58 +00:00
migrations Native assets support for Windows (#134203) 2023-09-27 12:22:58 +00:00
proxied_devices Make PollingDeviceDiscovery start the initial poll faster. (#130755) 2023-07-20 05:01:24 +00:00
reporting Revert "[flutter_tools] Remove sound null safety flag (#123031)" (#123280) 2023-03-22 22:53:49 +00:00
runner clean up --dart-define-from-file option tests (#135980) 2023-10-17 22:31:38 +00:00
test Reland "Switch flutter_tools to run frontend server from AOT snapshot" (#136282) 2023-10-11 16:15:26 -04:00
tester Native assets support for MacOS and iOS (#130494) 2023-09-10 08:07:13 +00:00
vscode [tool] In flutter doctor -v, warn when Android Studio version could not be detected. (#126395) 2023-06-01 14:51:30 +00:00
web Flutter preview device (#135639) 2023-10-18 00:27:54 +00:00
windows Native assets support for Windows (#134203) 2023-09-27 12:22:58 +00:00
analytics_test.dart Flutter preview device (#135639) 2023-10-18 00:27:54 +00:00
android_plugin_test.dart
application_package_test.dart Fix path name to discover debug apk on add2app builds (#117999) 2023-01-24 13:19:09 -08:00
args_test.dart [flutter_tools] Precache after channel switch (#118129) 2023-06-09 01:46:24 +00:00
artifact_updater_test.dart Enable unreachable_from_main lint - it is stable now!!1 (#129854) 2023-07-06 00:09:01 +00:00
artifacts_test.dart Reland "Switch flutter_tools to run frontend server from AOT snapshot" (#136282) 2023-10-11 16:15:26 -04:00
asset_bundle_package_fonts_test.dart rename generated asset manifest file back to AssetManifest.bin (from AssetManifest.smcbin) (#128529) 2023-06-09 21:20:50 +00:00
asset_bundle_package_test.dart rename generated asset manifest file back to AssetManifest.bin (from AssetManifest.smcbin) (#128529) 2023-06-09 21:20:50 +00:00
asset_bundle_test.dart [web] Encode AssetManifest.bin as JSON and use that on the web. (#131382) 2023-09-19 22:38:51 +00:00
asset_bundle_variant_test.dart rename generated asset manifest file back to AssetManifest.bin (from AssetManifest.smcbin) (#128529) 2023-06-09 21:20:50 +00:00
asset_test.dart [flutter_tools] re-enable web shader compilation (#118461) 2023-01-13 19:43:27 +00:00
base_utils_test.dart
build_info_test.dart do not include entries from --dart-define-from-file files in the gradle config or environment during build (#136865) 2023-10-19 21:01:51 +00:00
bundle_builder_test.dart Add --frontend-server-starter-path option to flutter run and flutter test (#135038) 2023-09-21 14:32:35 -04:00
cache_test.dart Allows adding a storage 'realm' to the storage base URL (#131951) 2023-08-09 23:26:05 +00:00
channel_test.dart [flutter_tools] Suppress git output in flutter channel (#128475) 2023-06-13 19:28:06 +00:00
cmake_test.dart Reduce usage of testUsingContext (#131078) 2023-07-24 17:22:25 +00:00
cold_test.dart [flutter_tool] Adds a flag to disable Impeller (#122960) 2023-03-20 22:23:23 -07:00
common_test.dart
compile_batch_test.dart Reland "Switch flutter_tools to run frontend server from AOT snapshot" (#136282) 2023-10-11 16:15:26 -04:00
compile_expression_test.dart Roll engine, patch expression evaluation (#128255) 2023-06-07 19:48:42 +00:00
compile_incremental_test.dart Reland "Switch flutter_tools to run frontend server from AOT snapshot" (#136282) 2023-10-11 16:15:26 -04:00
compile_test.dart Cleanup obsolete --compact-async compiler option (#118894) 2023-01-20 09:48:26 -08:00
config_test.dart [flutter_tools] fix Cannot delete file ENOENT from fuchsia_asset_builder (#119867) 2023-02-03 19:24:41 +00:00
convert_test.dart Remove unnecessary null checks in flutter_tool (#118857) 2023-01-23 21:43:08 +00:00
coverage_collector_test.dart Reverts "Use coverage.collect's coverableLineCache param to speed up coverage" (#137121) 2023-10-24 02:38:27 +00:00
crash_reporting_test.dart Appended period remove & Uri parsing fix. (#131293) 2023-07-31 20:42:11 +00:00
create_config_test.dart Suggest a potential valid name for the flutter project when using flutter create (#130900) 2023-07-21 19:09:25 +00:00
daemon_test.dart
dart_plugin_test.dart Don't rethrow Dart plugin registration exceptions (#122111) 2023-03-28 15:08:57 +00:00
desktop_device_test.dart Add --trace-to-file option to flutter run (#135713) 2023-10-12 13:23:52 -04:00
devfs_test.dart Native assets support for MacOS and iOS (#130494) 2023-09-10 08:07:13 +00:00
device_port_forwarder_test.dart Remove outdated ignores (#108924) 2022-08-03 23:37:05 +00:00
device_test.dart Add --trace-to-file option to flutter run (#135713) 2023-10-12 13:23:52 -04:00
devtools_launcher_test.dart
emulator_test.dart Reland "[tool] Move Java functions to their own file" (#126577) 2023-05-20 06:29:21 +00:00
fake_native_assets_build_runner.dart Native assets support for Windows (#134203) 2023-09-27 12:22:58 +00:00
fake_process_manager_test.dart
features_test.dart Native assets support for MacOS and iOS (#130494) 2023-09-10 08:07:13 +00:00
flutter_manifest_test.dart
flutter_platform_test.dart Upgrade framework pub dependencies, roll engine with rolled dart sdk (#130163) 2023-07-07 13:55:35 -07:00
flutter_project_metadata_test.dart Native assets support for MacOS and iOS (#130494) 2023-09-10 08:07:13 +00:00
flutter_tester_device_test.dart Fix race condition in flutter test when passing --serve-observatory (#123556) 2023-04-20 13:46:33 -04:00
flutter_validator_test.dart Give channel descriptions in flutter channel, use branch instead of upstream for channel name (#126936) 2023-05-23 19:59:20 +00:00
generate_localizations_test.dart Relax syntax for gen-l10n (#130736) 2023-07-18 13:59:48 -07:00
github_template_test.dart
hot_test.dart Native assets support for MacOS and iOS (#130494) 2023-09-10 08:07:13 +00:00
html_utils_test.dart flutter-tool, web: update HTML template serviceWorkerVersion to be const (#124826) 2023-04-14 02:01:21 +00:00
integration_test_device_test.dart Adds vmservices for getting iOS build options (#121736) 2023-03-06 22:37:55 +00:00
license_collector_test.dart
mdns_discovery_test.dart New tooling for iOS 17 physical devices (#131865) 2023-08-09 19:25:12 +00:00
message_parser_test.dart Relax syntax for gen-l10n (#130736) 2023-07-18 13:59:48 -07:00
persistent_tool_state_test.dart
plugin_parsing_test.dart Allow iOS and macOS plugins to share darwin directory (#115337) 2023-01-09 10:33:03 -08:00
plugins_test.dart [flutter_tools] handle ERROR_INVALID_FUNCTION when trying to symlink across drives (#136424) 2023-10-12 17:15:45 +00:00
preview_device_test.dart Don't build native assets in flutter build bundle (#136641) 2023-10-18 11:57:44 +00:00
project_file_invalidator_test.dart
project_test.dart Makes scheme and target optional parameter when getting universal lin… (#134571) 2023-09-15 21:01:05 +00:00
project_validator_result_test.dart
protocol_discovery_test.dart Reland "Remove references to Observatory (#118577)" (#121606) 2023-02-28 11:57:04 -05:00
pub_dependencies_project_validator_test.dart Add info project validator status (#109169) 2022-08-09 17:59:06 +00:00
resident_devtools_handler_test.dart Reland "Fix issue where DevTools would not be immediately available when using --start-paused (#126698)" (#129368) 2023-06-28 00:16:13 +05:30
resident_runner_test.dart [flutter_tools] fix tests with no native assets running native asset build (#135474) 2023-09-26 23:05:11 +00:00
resident_web_runner_cold_test.dart Audit covariant usage in tool (#116930) 2022-12-15 11:59:34 -08:00
resident_web_runner_test.dart [tool] fallback to sigkill when closing Chromium (#135521) 2023-09-28 22:28:31 +00:00
run_hot_test.dart Reduce usage of testUsingContext (#131078) 2023-07-24 17:22:25 +00:00
template_test.dart Locate the template directory using a TemplatePathProvider. (#132156) 2023-08-08 21:43:00 +00:00
terminal_handler_test.dart [flutter_tools] remove VmService screenshot for native devices. (#135462) 2023-09-29 00:21:14 +00:00
testbed_test.dart
time_test.dart
tracing_test.dart
unified_analytics_test.dart Update logic for getting Analytics instance from package:unified_analytics (#134756) 2023-09-29 16:20:16 +00:00
update_packages_test.dart Pin leak_tracker before publishing breaking change. (#135720) 2023-09-28 17:03:23 -07:00
utils_test.dart fix(flutter_tools): findBundleFile w/multiple flavor dimensions (#127133) 2023-05-19 15:00:53 +00:00
version_test.dart [flutter_tools] Fix "FormatException: Invalid date format" during version freshness check (#134088) 2023-09-06 17:22:13 +00:00
vmservice_test.dart [flutter_tools] remove VmService screenshot for native devices. (#135462) 2023-09-29 00:21:14 +00:00
windows_version_validator_test.dart Refactoring to use ver command instead of systeminfo (#119304) 2023-01-30 19:29:13 +00:00
xcode_backend_test.dart Add --frontend-server-starter-path option to flutter run and flutter test (#135038) 2023-09-21 14:32:35 -04:00