Update dependencies to pull in new vm_service, dds, dwds, coverage, etc (#98513)

This commit is contained in:
Ben Konyi
2022-02-18 12:32:08 -08:00
committed by GitHub
parent 081d960237
commit 50c4720913
47 changed files with 198 additions and 239 deletions

View File

@@ -167,7 +167,7 @@ Future<void> run(List<String> args) async {
} else {
globals.fs.currentDirectory = testDirectory;
}
if (!await collector.collectCoverageData(argResults[_kOptionCoveragePath] as String, coverageDirectory: coverageDirectory)) {
if (!collector.collectCoverageData(argResults[_kOptionCoveragePath] as String, coverageDirectory: coverageDirectory)) {
throwToolExit('Failed to collect coverage data');
}
}

View File

@@ -149,7 +149,7 @@ class SizeAnalyzer {
final Map<List<String>, int> pathsToSize = <List<String>, int>{};
for (final ArchiveFile archiveFile in archive.files) {
final InputStream? rawContent = archiveFile.rawContent;
final InputStreamBase? rawContent = archiveFile.rawContent;
if (rawContent != null) {
pathsToSize[_fileSystem.path.split(archiveFile.name)] = rawContent.length;
}

View File

@@ -459,7 +459,7 @@ class TestCommand extends FlutterCommand with DeviceBasedDevelopmentArtifacts {
);
if (collector != null) {
final bool collectionResult = await collector.collectCoverageData(
final bool collectionResult = collector.collectCoverageData(
stringArg('coverage-path'),
mergeCoverageData: boolArg('merge-coverage'),
);

View File

@@ -29,6 +29,7 @@ import '../runner/flutter_command.dart';
/// in ways that prevent them from every upgrading Flutter again!
const Map<String, String> kManuallyPinnedDependencies = <String, String>{
// Add pinned packages here. Please leave a comment explaining why.
'archive': '3.1.11', // Breaking changes in 3.2.0, see https://github.com/flutter/flutter/issues/98536
'flutter_gallery_assets': '1.0.2', // Tests depend on the exact version.
'flutter_template_images': '4.0.0', // Must always exactly match flutter_tools template.
// "shelf" is pinned to avoid the performance regression from a reverted

View File

@@ -253,25 +253,6 @@ class FlutterDebugAdapter extends DartDebugAdapter<FlutterLaunchRequestArguments
...?userArgs,
];
// Find the package_config file for this script. This is used by the
// debugger to map package: URIs to file paths to check whether they're in
// the editors workspace (args.cwd/args.additionalProjectPaths) so they can
// be correctly classes as "my code", "sdk" or "external packages".
// TODO(dantup): Remove this once https://github.com/dart-lang/sdk/issues/45530
// is done as it will not be necessary.
final String? possibleRoot = targetProgram == null
? args.cwd
: fileSystem.path.isAbsolute(targetProgram)
? fileSystem.path.dirname(targetProgram)
: fileSystem.path.dirname(
fileSystem.path.normalize(fileSystem.path.join(args.cwd ?? '', targetProgram)));
if (possibleRoot != null) {
final File? packageConfig = findPackageConfigFile(possibleRoot);
if (packageConfig != null) {
usePackageConfigFile(packageConfig);
}
}
await launchAsProcess(executable, processArgs);
// Delay responding until the app is launched and (optionally) the debugger

View File

@@ -116,25 +116,6 @@ class FlutterTestDebugAdapter extends DartDebugAdapter<FlutterLaunchRequestArgum
...?args.args,
];
// Find the package_config file for this script. This is used by the
// debugger to map package: URIs to file paths to check whether they're in
// the editors workspace (args.cwd/args.additionalProjectPaths) so they can
// be correctly classes as "my code", "sdk" or "external packages".
// TODO(dantup): Remove this once https://github.com/dart-lang/sdk/issues/45530
// is done as it will not be necessary.
final String? possibleRoot = program == null
? args.cwd
: fileSystem.path.isAbsolute(program)
? fileSystem.path.dirname(program)
: fileSystem.path.dirname(
fileSystem.path.normalize(fileSystem.path.join(args.cwd ?? '', args.program)));
if (possibleRoot != null) {
final File? packageConfig = findPackageConfigFile(possibleRoot);
if (packageConfig != null) {
usePackageConfigFile(packageConfig);
}
}
await launchAsProcess(executable, processArgs);
// Delay responding until the debugger is connected.

View File

@@ -23,7 +23,7 @@ class CoverageCollector extends TestWatcher {
final bool verbose;
final String packagesPath;
Map<String, Map<int, int>> _globalHitmap;
Map<String, coverage.HitMap> _globalHitmap;
bool Function(String) libraryPredicate;
@override
@@ -43,11 +43,11 @@ class CoverageCollector extends TestWatcher {
}
}
void _addHitmap(Map<String, Map<int, int>> hitmap) {
void _addHitmap(Map<String, coverage.HitMap> hitmap) {
if (_globalHitmap == null) {
_globalHitmap = hitmap;
} else {
coverage.mergeHitmaps(hitmap, _globalHitmap);
_globalHitmap.merge(hitmap);
}
}
@@ -67,7 +67,7 @@ class CoverageCollector extends TestWatcher {
assert(data != null);
_logMessage('($observatoryUri): collected coverage data; merging...');
_addHitmap(await coverage.createHitmap(
_addHitmap(await coverage.HitMap.parseJson(
data['coverage'] as List<Map<String, dynamic>>,
packagesPath: packagesPath,
checkIgnoredLines: true,
@@ -110,7 +110,7 @@ class CoverageCollector extends TestWatcher {
assert(data != null);
_logMessage('Merging coverage data...');
_addHitmap(await coverage.createHitmap(
_addHitmap(await coverage.HitMap.parseJson(
data['coverage'] as List<Map<String, dynamic>>,
packagesPath: packagesPath,
checkIgnoredLines: true,
@@ -118,33 +118,29 @@ class CoverageCollector extends TestWatcher {
_logMessage('Done merging coverage data into global coverage map.');
}
/// Returns a future that will complete with the formatted coverage data
/// (using [formatter]) once all coverage data has been collected.
/// Returns formatted coverage data once all coverage data has been collected.
///
/// This will not start any collection tasks. It us up to the caller of to
/// call [collectCoverage] for each process first.
Future<String> finalizeCoverage({
coverage.Formatter formatter,
String finalizeCoverage({
coverage.Resolver resolver,
Directory coverageDirectory,
}) async {
}) {
if (_globalHitmap == null) {
return null;
}
if (formatter == null) {
final coverage.Resolver resolver = coverage.Resolver(packagesPath: packagesPath);
final String packagePath = globals.fs.currentDirectory.path;
final List<String> reportOn = coverageDirectory == null
? <String>[globals.fs.path.join(packagePath, 'lib')]
: <String>[coverageDirectory.path];
formatter = coverage.LcovFormatter(resolver, reportOn: reportOn, basePath: packagePath);
}
final String result = await formatter.format(_globalHitmap);
resolver ??= coverage.Resolver(packagesPath: packagesPath);
final String packagePath = globals.fs.currentDirectory.path;
final List<String> reportOn = coverageDirectory == null
? <String>[globals.fs.path.join(packagePath, 'lib')]
: <String>[coverageDirectory.path];
final String result = _globalHitmap.formatLcov(resolver, reportOn: reportOn, basePath: packagePath);
_globalHitmap = null;
return result;
}
Future<bool> collectCoverageData(String coveragePath, { bool mergeCoverageData = false, Directory coverageDirectory }) async {
final String coverageData = await finalizeCoverage(
bool collectCoverageData(String coveragePath, { bool mergeCoverageData = false, Directory coverageDirectory }) {
final String coverageData = finalizeCoverage(
coverageDirectory: coverageDirectory,
);
_logMessage('coverage information collection complete');

View File

@@ -10,10 +10,10 @@ dependencies:
archive: 3.1.11
args: 2.3.0
browser_launcher: 1.0.0
dds: 2.1.6+3
dwds: 11.5.1
dds: 2.2.0
dwds: 12.1.0
completion: 1.0.0
coverage: 1.0.3
coverage: 1.1.0
crypto: 3.0.1
file: 6.1.2
flutter_template_images: 4.0.0
@@ -45,7 +45,7 @@ dependencies:
path: 1.8.1
mime: 1.0.1
logging: 1.0.2
http_multi_server: 3.0.1
http_multi_server: 3.2.0
convert: 3.0.1
async: 2.8.2
@@ -55,7 +55,7 @@ dependencies:
test_api: 0.4.9
test_core: 0.4.11
vm_service: 7.5.0
vm_service: 8.1.0
_fe_analyzer_shared: 34.0.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
analyzer: 3.2.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
@@ -66,7 +66,8 @@ dependencies:
cli_util: 0.3.5 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
clock: 1.1.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
csslib: 0.17.1 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
devtools_shared: 2.8.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
dds_service_extensions: 1.3.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
devtools_shared: 2.9.4 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
fixnum: 1.0.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
frontend_server_client: 2.1.2 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
glob: 2.0.2 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
@@ -104,4 +105,4 @@ dartdoc:
# Exclude this package from the hosted API docs.
nodoc: true
# PUBSPEC CHECKSUM: 1ac1
# PUBSPEC CHECKSUM: 1fe9