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.
This commit is contained in:
parent
bd5e8db3a3
commit
c564007f94
@ -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
|
commits in the pull request. The latter method makes it easier to
|
||||||
detect regressions but costs more test resources.
|
detect regressions but costs more test resources.
|
||||||
|
|
||||||
Ths `bin/internal/flutter_plugins.version` file specifies the version
|
The `bin/internal/flutter_packages.version` file specifies the version
|
||||||
of the `flutter/plugins` repository to be used for testing. The
|
of the `flutter/packages` repository to be used for testing. The
|
||||||
`flutter/plugins` repository isn't an upstream dependency of
|
`flutter/packages` repository isn't an upstream dependency of
|
||||||
`flutter/flutter`; it is only used as part of the test suite for
|
`flutter/flutter`; it is only used as part of the test suite for
|
||||||
verification, and the pinned version here makes sure that tests are
|
verification, and the pinned version here makes sure that tests are
|
||||||
deterministic at each `flutter/flutter` commit.
|
deterministic at each `flutter/flutter` commit.
|
||||||
|
1
bin/internal/flutter_packages.version
Normal file
1
bin/internal/flutter_packages.version
Normal file
@ -0,0 +1 @@
|
|||||||
|
6c04c745b0ed7b263de0b8ec9c23d294ac81b227
|
@ -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 dart = path.join(flutterRoot, 'bin', 'cache', 'dart-sdk', 'bin', 'dart$exe');
|
||||||
final String pubCache = path.join(flutterRoot, '.pub-cache');
|
final String pubCache = path.join(flutterRoot, '.pub-cache');
|
||||||
final String engineVersionFile = path.join(flutterRoot, 'bin', 'internal', 'engine.version');
|
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 {
|
String get platformFolderName {
|
||||||
if (Platform.isWindows) {
|
if (Platform.isWindows) {
|
||||||
@ -256,7 +256,7 @@ Future<void> main(List<String> args) async {
|
|||||||
'web_canvaskit_tests': _runWebCanvasKitUnitTests,
|
'web_canvaskit_tests': _runWebCanvasKitUnitTests,
|
||||||
// All web integration tests
|
// All web integration tests
|
||||||
'web_long_running_tests': _runWebLongRunningTests,
|
'web_long_running_tests': _runWebLongRunningTests,
|
||||||
'flutter_plugins': _runFlutterPluginsTests,
|
'flutter_plugins': _runFlutterPackagesTests,
|
||||||
'skp_generator': _runSkpGeneratorTests,
|
'skp_generator': _runSkpGeneratorTests,
|
||||||
kTestHarnessShardName: _runTestHarnessTests, // Used for testing this script; also run as part of SHARD=framework_tests, SUBSHARD=misc.
|
kTestHarnessShardName: _runTestHarnessTests, // Used for testing this script; also run as part of SHARD=framework_tests, SUBSHARD=misc.
|
||||||
});
|
});
|
||||||
@ -1390,56 +1390,56 @@ Future<void> _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
|
/// 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
|
/// flutter commit the flutter/packages commit hash to test against is coded in
|
||||||
/// the bin/internal/flutter_plugins.version file.
|
/// the bin/internal/flutter_packages.version file.
|
||||||
///
|
///
|
||||||
/// The `filesystem` parameter specified filesystem to read the plugins version file from.
|
/// The `filesystem` parameter specified filesystem to read the packages version file from.
|
||||||
/// The `pluginsVersionFile` parameter allows specifying an alternative path for the
|
/// The `packagesVersionFile` parameter allows specifying an alternative path for the
|
||||||
/// plugins version file, when null [flutterPluginsVersionFile] is used.
|
/// packages version file, when null [flutterPackagesVersionFile] is used.
|
||||||
Future<String> getFlutterPluginsVersion({
|
Future<String> getFlutterPackagesVersion({
|
||||||
fs.FileSystem fileSystem = const LocalFileSystem(),
|
fs.FileSystem fileSystem = const LocalFileSystem(),
|
||||||
String? pluginsVersionFile,
|
String? packagesVersionFile,
|
||||||
}) async {
|
}) async {
|
||||||
final File versionFile = fileSystem.file(pluginsVersionFile ?? flutterPluginsVersionFile);
|
final File versionFile = fileSystem.file(packagesVersionFile ?? flutterPackagesVersionFile);
|
||||||
final String versionFileContents = await versionFile.readAsString();
|
final String versionFileContents = await versionFile.readAsString();
|
||||||
return versionFileContents.trim();
|
return versionFileContents.trim();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Executes the test suite for the flutter/plugins repo.
|
/// Executes the test suite for the flutter/packages repo.
|
||||||
Future<void> _runFlutterPluginsTests() async {
|
Future<void> _runFlutterPackagesTests() async {
|
||||||
Future<void> runAnalyze() async {
|
Future<void> runAnalyze() async {
|
||||||
printProgress('${green}Running analysis for flutter/plugins$reset');
|
printProgress('${green}Running analysis for flutter/packages$reset');
|
||||||
final Directory checkout = Directory.systemTemp.createTempSync('flutter_plugins.');
|
final Directory checkout = Directory.systemTemp.createTempSync('flutter_packages.');
|
||||||
await runCommand(
|
await runCommand(
|
||||||
'git',
|
'git',
|
||||||
<String>[
|
<String>[
|
||||||
'-c',
|
'-c',
|
||||||
'core.longPaths=true',
|
'core.longPaths=true',
|
||||||
'clone',
|
'clone',
|
||||||
'https://github.com/flutter/plugins.git',
|
'https://github.com/flutter/packages.git',
|
||||||
'.',
|
'.',
|
||||||
],
|
],
|
||||||
workingDirectory: checkout.path,
|
workingDirectory: checkout.path,
|
||||||
);
|
);
|
||||||
final String pluginsCommit = await getFlutterPluginsVersion();
|
final String packagesCommit = await getFlutterPackagesVersion();
|
||||||
await runCommand(
|
await runCommand(
|
||||||
'git',
|
'git',
|
||||||
<String>[
|
<String>[
|
||||||
'-c',
|
'-c',
|
||||||
'core.longPaths=true',
|
'core.longPaths=true',
|
||||||
'checkout',
|
'checkout',
|
||||||
pluginsCommit,
|
packagesCommit,
|
||||||
],
|
],
|
||||||
workingDirectory: checkout.path,
|
workingDirectory: checkout.path,
|
||||||
);
|
);
|
||||||
// Prep the repository tooling.
|
// Prep the repository tooling.
|
||||||
// This test does not use tool_runner.sh because in this context the test
|
// 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
|
// should always run on the entire packages repo, while tool_runner.sh
|
||||||
// is designed for flutter/plugins CI and only analyzes changed repository
|
// is designed for flutter/packages CI and only analyzes changed repository
|
||||||
// files when run for anything but master.
|
// files when run for anything but master.
|
||||||
final String toolDir = path.join(checkout.path, 'script', 'tool');
|
final String toolDir = path.join(checkout.path, 'script', 'tool');
|
||||||
await runCommand(
|
await runCommand(
|
||||||
|
@ -82,23 +82,23 @@ void main() {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
group('flutter/plugins version', () {
|
group('flutter/pacakges version', () {
|
||||||
final MemoryFileSystem memoryFileSystem = MemoryFileSystem();
|
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';
|
const String kSampleHash = '592b5b27431689336fa4c721a099eedf787aeb56';
|
||||||
setUpAll(() {
|
setUpAll(() {
|
||||||
pluginsVersionFile.createSync(recursive: true);
|
packagesVersionFile.createSync(recursive: true);
|
||||||
});
|
});
|
||||||
|
|
||||||
test('commit hash', () async {
|
test('commit hash', () async {
|
||||||
pluginsVersionFile.writeAsStringSync(kSampleHash);
|
packagesVersionFile.writeAsStringSync(kSampleHash);
|
||||||
final String actualHash = await getFlutterPluginsVersion(fileSystem: memoryFileSystem, pluginsVersionFile: pluginsVersionFile.path);
|
final String actualHash = await getFlutterPackagesVersion(fileSystem: memoryFileSystem, packagesVersionFile: packagesVersionFile.path);
|
||||||
expect(actualHash, kSampleHash);
|
expect(actualHash, kSampleHash);
|
||||||
});
|
});
|
||||||
|
|
||||||
test('commit hash with newlines', () async {
|
test('commit hash with newlines', () async {
|
||||||
pluginsVersionFile.writeAsStringSync('\n$kSampleHash\n');
|
packagesVersionFile.writeAsStringSync('\n$kSampleHash\n');
|
||||||
final String actualHash = await getFlutterPluginsVersion(fileSystem: memoryFileSystem, pluginsVersionFile: pluginsVersionFile.path);
|
final String actualHash = await getFlutterPackagesVersion(fileSystem: memoryFileSystem, packagesVersionFile: packagesVersionFile.path);
|
||||||
expect(actualHash, kSampleHash);
|
expect(actualHash, kSampleHash);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user