Add flutter update packages to some tests. (#75530)

* Add flutter update packages to some tests.

Analyzer_benchmark and flutter_test_performance require to pub get
multiple directories. Rather than delegating the recipes to run flutter
update-packages we explicitly running on tests that need it.

Bug: https://github.com/flutter/flutter/issues/75524

* Add pub get directly on the analyis classes.

* Run flutter get in dev/tools.

* Fix directory path.

* Add more dependency directories.

* Fix typo.

* Add more dependencies.

* Add stocks dependency.

* Fix paths to some apps.

* Add more dependencies.

* Complete dependencies definition.

* More analysis dependencies.

* Add examples dependencies.

* Dev tool dependencies.

* Use update-packages for analyzer benchmark.
This commit is contained in:
godofredoc
2021-02-11 15:30:55 -08:00
committed by GitHub
parent afd1d92a01
commit a0e8681452
2 changed files with 17 additions and 8 deletions

View File

@@ -101,11 +101,20 @@ Future<int> runTest({bool coverage = false, bool noPub = false}) async {
return clock.elapsedMilliseconds;
}
Future<void> pubGetDependencies(List<Directory> directories) async {
for (final Directory directory in directories) {
await inDirectory<void>(directory, () async {
await flutter('pub', options: <String>['get']);
});
}
}
void main() {
task(() async {
final File nodeSourceFile = File(path.join(
flutterDirectory.path, 'packages', 'flutter', 'lib', 'src', 'foundation', 'node.dart',
));
await pubGetDependencies(<Directory>[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