From c564007f94f0f43700c97390c3513c92a45268e8 Mon Sep 17 00:00:00 2001 From: stuartmorgan Date: Tue, 21 Feb 2023 11:26:08 -0800 Subject: [PATCH] Switch analysis to flutter/packages (#120908) In preparation for the merge of flutter/plugins into flutter/packaegs, update the cross-repo analysis to flutter/packages rather than flutter/plugins. The flutter_plugins.version file is left intentionally for now to avoid issues with the roller; it will be removed when the roller has been updated to roll the other repository. --- bin/internal/README.md | 6 ++-- bin/internal/flutter_packages.version | 1 + dev/bots/test.dart | 42 +++++++++++++-------------- dev/bots/test/test_test.dart | 14 ++++----- 4 files changed, 32 insertions(+), 31 deletions(-) create mode 100644 bin/internal/flutter_packages.version diff --git a/bin/internal/README.md b/bin/internal/README.md index ce7ec85f2f..8e7047f9d2 100644 --- a/bin/internal/README.md +++ b/bin/internal/README.md @@ -19,9 +19,9 @@ number of commits in the framework is equal to the number of engine commits in the pull request. The latter method makes it easier to detect regressions but costs more test resources. -Ths `bin/internal/flutter_plugins.version` file specifies the version -of the `flutter/plugins` repository to be used for testing. The -`flutter/plugins` repository isn't an upstream dependency of +The `bin/internal/flutter_packages.version` file specifies the version +of the `flutter/packages` repository to be used for testing. The +`flutter/packages` repository isn't an upstream dependency of `flutter/flutter`; it is only used as part of the test suite for verification, and the pinned version here makes sure that tests are deterministic at each `flutter/flutter` commit. diff --git a/bin/internal/flutter_packages.version b/bin/internal/flutter_packages.version new file mode 100644 index 0000000000..8413d2f6b9 --- /dev/null +++ b/bin/internal/flutter_packages.version @@ -0,0 +1 @@ +6c04c745b0ed7b263de0b8ec9c23d294ac81b227 diff --git a/dev/bots/test.dart b/dev/bots/test.dart index bd8f32e2d2..3144cd2668 100644 --- a/dev/bots/test.dart +++ b/dev/bots/test.dart @@ -83,7 +83,7 @@ final String flutter = path.join(flutterRoot, 'bin', 'flutter$bat'); final String dart = path.join(flutterRoot, 'bin', 'cache', 'dart-sdk', 'bin', 'dart$exe'); final String pubCache = path.join(flutterRoot, '.pub-cache'); final String engineVersionFile = path.join(flutterRoot, 'bin', 'internal', 'engine.version'); -final String flutterPluginsVersionFile = path.join(flutterRoot, 'bin', 'internal', 'flutter_plugins.version'); +final String flutterPackagesVersionFile = path.join(flutterRoot, 'bin', 'internal', 'flutter_packages.version'); String get platformFolderName { if (Platform.isWindows) { @@ -256,7 +256,7 @@ Future main(List args) async { 'web_canvaskit_tests': _runWebCanvasKitUnitTests, // All web integration tests 'web_long_running_tests': _runWebLongRunningTests, - 'flutter_plugins': _runFlutterPluginsTests, + 'flutter_plugins': _runFlutterPackagesTests, 'skp_generator': _runSkpGeneratorTests, kTestHarnessShardName: _runTestHarnessTests, // Used for testing this script; also run as part of SHARD=framework_tests, SUBSHARD=misc. }); @@ -1390,56 +1390,56 @@ Future _runWebTreeshakeTest() async { } } -/// Returns the commit hash of the flutter/plugins repository that's rolled in. +/// Returns the commit hash of the flutter/packages repository that's rolled in. /// -/// The flutter/plugins repository is a downstream dependency, it is only used +/// The flutter/packages repository is a downstream dependency, it is only used /// by flutter/flutter for testing purposes, to assure stable tests for a given -/// flutter commit the flutter/plugins commit hash to test against is coded in -/// the bin/internal/flutter_plugins.version file. +/// flutter commit the flutter/packages commit hash to test against is coded in +/// the bin/internal/flutter_packages.version file. /// -/// The `filesystem` parameter specified filesystem to read the plugins version file from. -/// The `pluginsVersionFile` parameter allows specifying an alternative path for the -/// plugins version file, when null [flutterPluginsVersionFile] is used. -Future getFlutterPluginsVersion({ +/// The `filesystem` parameter specified filesystem to read the packages version file from. +/// The `packagesVersionFile` parameter allows specifying an alternative path for the +/// packages version file, when null [flutterPackagesVersionFile] is used. +Future getFlutterPackagesVersion({ fs.FileSystem fileSystem = const LocalFileSystem(), - String? pluginsVersionFile, + String? packagesVersionFile, }) async { - final File versionFile = fileSystem.file(pluginsVersionFile ?? flutterPluginsVersionFile); + final File versionFile = fileSystem.file(packagesVersionFile ?? flutterPackagesVersionFile); final String versionFileContents = await versionFile.readAsString(); return versionFileContents.trim(); } -/// Executes the test suite for the flutter/plugins repo. -Future _runFlutterPluginsTests() async { +/// Executes the test suite for the flutter/packages repo. +Future _runFlutterPackagesTests() async { Future runAnalyze() async { - printProgress('${green}Running analysis for flutter/plugins$reset'); - final Directory checkout = Directory.systemTemp.createTempSync('flutter_plugins.'); + printProgress('${green}Running analysis for flutter/packages$reset'); + final Directory checkout = Directory.systemTemp.createTempSync('flutter_packages.'); await runCommand( 'git', [ '-c', 'core.longPaths=true', 'clone', - 'https://github.com/flutter/plugins.git', + 'https://github.com/flutter/packages.git', '.', ], workingDirectory: checkout.path, ); - final String pluginsCommit = await getFlutterPluginsVersion(); + final String packagesCommit = await getFlutterPackagesVersion(); await runCommand( 'git', [ '-c', 'core.longPaths=true', 'checkout', - pluginsCommit, + packagesCommit, ], workingDirectory: checkout.path, ); // Prep the repository tooling. // This test does not use tool_runner.sh because in this context the test - // should always run on the entire plugins repo, while tool_runner.sh - // is designed for flutter/plugins CI and only analyzes changed repository + // should always run on the entire packages repo, while tool_runner.sh + // is designed for flutter/packages CI and only analyzes changed repository // files when run for anything but master. final String toolDir = path.join(checkout.path, 'script', 'tool'); await runCommand( diff --git a/dev/bots/test/test_test.dart b/dev/bots/test/test_test.dart index ddf1009c66..9d9d4cc28f 100644 --- a/dev/bots/test/test_test.dart +++ b/dev/bots/test/test_test.dart @@ -82,23 +82,23 @@ void main() { }); }); - group('flutter/plugins version', () { + group('flutter/pacakges version', () { final MemoryFileSystem memoryFileSystem = MemoryFileSystem(); - final fs.File pluginsVersionFile = memoryFileSystem.file(path.join('bin','internal','flutter_plugins.version')); + final fs.File packagesVersionFile = memoryFileSystem.file(path.join('bin','internal','flutter_packages.version')); const String kSampleHash = '592b5b27431689336fa4c721a099eedf787aeb56'; setUpAll(() { - pluginsVersionFile.createSync(recursive: true); + packagesVersionFile.createSync(recursive: true); }); test('commit hash', () async { - pluginsVersionFile.writeAsStringSync(kSampleHash); - final String actualHash = await getFlutterPluginsVersion(fileSystem: memoryFileSystem, pluginsVersionFile: pluginsVersionFile.path); + packagesVersionFile.writeAsStringSync(kSampleHash); + final String actualHash = await getFlutterPackagesVersion(fileSystem: memoryFileSystem, packagesVersionFile: packagesVersionFile.path); expect(actualHash, kSampleHash); }); test('commit hash with newlines', () async { - pluginsVersionFile.writeAsStringSync('\n$kSampleHash\n'); - final String actualHash = await getFlutterPluginsVersion(fileSystem: memoryFileSystem, pluginsVersionFile: pluginsVersionFile.path); + packagesVersionFile.writeAsStringSync('\n$kSampleHash\n'); + final String actualHash = await getFlutterPackagesVersion(fileSystem: memoryFileSystem, packagesVersionFile: packagesVersionFile.path); expect(actualHash, kSampleHash); }); });