diff --git a/dev/devicelab/bin/tasks/flutter_test_performance.dart b/dev/devicelab/bin/tasks/flutter_test_performance.dart index b3f8c072d37..0b255dfa8f0 100644 --- a/dev/devicelab/bin/tasks/flutter_test_performance.dart +++ b/dev/devicelab/bin/tasks/flutter_test_performance.dart @@ -101,11 +101,20 @@ Future runTest({bool coverage = false, bool noPub = false}) async { return clock.elapsedMilliseconds; } +Future pubGetDependencies(List directories) async { + for (final Directory directory in directories) { + await inDirectory(directory, () async { + await flutter('pub', options: ['get']); + }); + } +} + void main() { task(() async { final File nodeSourceFile = File(path.join( flutterDirectory.path, 'packages', 'flutter', 'lib', 'src', 'foundation', 'node.dart', )); + await pubGetDependencies([Directory(path.join(flutterDirectory.path, 'dev', 'automated_tests')),]); final String originalSource = await nodeSourceFile.readAsString(); try { await runTest(noPub: true); // first number is meaningless; could have had to build the tool, run pub get, have a cache, etc diff --git a/dev/devicelab/lib/tasks/analysis.dart b/dev/devicelab/lib/tasks/analysis.dart index c3c5494c2a7..30fa74e5c7b 100644 --- a/dev/devicelab/lib/tasks/analysis.dart +++ b/dev/devicelab/lib/tasks/analysis.dart @@ -24,6 +24,7 @@ Future analyzerBenchmarkTask() async { await inDirectory(flutterDirectory, () async { rmTree(_megaGalleryDirectory); mkdirs(_megaGalleryDirectory); + await flutter('update-packages'); await dart(['dev/tools/mega_gallery.dart', '--out=${_megaGalleryDirectory.path}']); }); @@ -56,7 +57,7 @@ class _BenchmarkResult { } abstract class _Benchmark { - _Benchmark({ this.watch = false }); + _Benchmark({this.watch = false}); final bool watch; @@ -65,9 +66,9 @@ abstract class _Benchmark { Directory get directory; List get options => [ - '--benchmark', - if (watch) '--watch', - ]; + '--benchmark', + if (watch) '--watch', + ]; Future execute(int iteration, int targetIterations) async { section('Analyze $title ${watch ? 'with watcher' : ''} - ${iteration + 1} / $targetIterations'); @@ -83,7 +84,7 @@ abstract class _Benchmark { /// Times how long it takes to analyze the Flutter repository. class _FlutterRepoBenchmark extends _Benchmark { - _FlutterRepoBenchmark({ bool watch = false }) : super(watch: watch); + _FlutterRepoBenchmark({bool watch = false}) : super(watch: watch); @override String get title => 'Flutter repo'; @@ -93,14 +94,13 @@ class _FlutterRepoBenchmark extends _Benchmark { @override List get options { - return super.options - ..add('--flutter-repo'); + return super.options..add('--flutter-repo'); } } /// Times how long it takes to analyze the generated "mega_gallery" app. class _MegaGalleryBenchmark extends _Benchmark { - _MegaGalleryBenchmark({ bool watch = false }) : super(watch: watch); + _MegaGalleryBenchmark({bool watch = false}) : super(watch: watch); @override String get title => 'mega gallery';