-
Notifications
You must be signed in to change notification settings - Fork 29.8k
Description
In #103771, we rolled dependencies in Flutter, which triggered an update of package:coverage to v1.3.1. The new version includes dart-archive/coverage#370 in which two deprecations landed:
- The
Resolverdefault constructor was deprecated and replaced with theResolver.createstatic factory method, which unfortunately happens to be async. - The
packagesPathparameter toHitMap.parseJson, which takes the path to the.packagesfile of the package for which coverage is to be collected, was deprecated. This parameter was replaced withpackagePathin Deprecate --packages flag and add --package dart-archive/coverage#370 which was part of the overall deprecation of the .packages file in Dart itself [breaking change] discontinue .packages file dart-lang/sdk#48272. The overall goal being that end-user code shouldn't need to know about implementation details such as whether dependency information is stored in a .packages file or a package_info.json file, but rather use the package_config package to obtain the package metadata and perform other functions such as resolving its dependencies to filesystem paths. packagesPath was replaced by packagePath, which takes the path to the package directory itself. Internally, package:coverage then uses package_config to do the rest of the package/script URI resolution to filesystem paths.
These two deprecations affect a few call sites in flutter_tools in:
- lib/src/test/coverage_collector.dart
Since we'll need to make collectCoverageData and finalizeCoverage async, this will also mean adding awaits, marking methods async, and migrating return types to Futures as necessary in:
- packages/flutter_tools/bin/fuchsia_tester.dart
- packages/flutter_tools/lib/src/commands/test.dart
finalizeCollectionin host_entrypoint.dart internally (/cc @xster)
#103771 landed migrations off of the deprecated code, but could not be landed in Flutter, since these patches break google3 because package:coverage hasn't been rolled internally. As a workaround, I've partially reverted the changes and marked them as ignored until package:coverage has rolled to Google.
Once package:coverage rolls to google3, we can re-apply the above-mentioned migrations (instructions added in TODOs).