Unverified Commit f761ae2c authored by Jenn Magder's avatar Jenn Magder Committed by GitHub

Adopt tool_test shard builders (#75171)

parent 9fd5242e
......@@ -119,8 +119,6 @@ Future<void> main(List<String> args) async {
'framework_tests': _runFrameworkTests,
'tool_coverage': _runToolCoverage,
'tool_tests': _runToolTests,
'tool_general_tests': _runGeneralToolTests,
'tool_command_tests': _runCommandsToolTests,
'tool_integration_tests': _runIntegrationToolTests,
'web_tool_tests': _runWebToolTests,
'web_tests': _runWebUnitTests,
......@@ -348,39 +346,11 @@ Future<void> _runIntegrationToolTests() async {
);
}
// TODO(jmagman): Remove once LUCI configs are migrated to tool_tests_general, tool_tests_command, and tool_tests_integration.
Future<void> _runToolTests() async {
const String kDotShard = '.shard';
const String kWeb = 'web';
const String kTest = 'test';
final String toolsPath = path.join(flutterRoot, 'packages', 'flutter_tools');
final Map<String, ShardRunner> subshards = Map<String, ShardRunner>.fromIterable(
Directory(path.join(toolsPath, kTest))
.listSync()
.map<String>((FileSystemEntity entry) => entry.path)
.where((String name) => name.endsWith(kDotShard))
.where((String name) => path.basenameWithoutExtension(name) != kWeb)
.map<String>((String name) => path.basenameWithoutExtension(name)),
// The `dynamic` on the next line is because Map.fromIterable isn't generic.
value: (dynamic subshard) => () async {
// Due to https://github.com/flutter/flutter/issues/46180, skip the hermetic directory
// on Windows.
final String suffix = Platform.isWindows && subshard == 'commands'
? 'permeable'
: '';
await _pubRunTest(
toolsPath,
forceSingleCore: subshard != 'general',
testPaths: <String>[path.join(kTest, '$subshard$kDotShard', suffix)],
enableFlutterToolAsserts: subshard != 'general',
// Detect unit test time regressions (poor time delay handling, etc).
perTestTimeout: (subshard == 'general') ? const Duration(seconds: 2) : null,
);
},
);
await selectSubshard(subshards);
await selectSubshard(<String, ShardRunner>{
'general': _runGeneralToolTests,
'commands': _runCommandsToolTests,
});
}
Future<void> _runWebToolTests() async {
......
......@@ -378,6 +378,12 @@
"task_name": "linux_tool_tests",
"flaky": false
},
{
"name": "Linux tool_integration_tests",
"repo": "flutter",
"task_name": "linux_tool_integration_tests",
"flaky": true
},
{
"name": "Linux web_tool_tests",
"repo": "flutter",
......@@ -762,6 +768,12 @@
"task_name": "mac_tool_tests",
"flaky": false
},
{
"name": "Mac tool_integration_tests",
"repo": "flutter",
"task_name": "mac_tool_integration_tests",
"flaky": true
},
{
"name": "Windows build_aar_module_test",
"repo": "flutter",
......@@ -840,6 +852,12 @@
"task_name": "win_tool_tests",
"flaky": false
},
{
"name": "Windows tool_integration_tests",
"repo": "flutter",
"task_name": "win_tool_integration_tests",
"flaky": true
},
{
"name": "Windows web_tool_tests",
"repo": "flutter",
......
......@@ -133,6 +133,13 @@
"enabled":true,
"run_if":["dev/", "packages/flutter_tools/", "bin/"]
},
{
"name":"Linux tool_integration_tests",
"repo":"flutter",
"task_name":"linux_tool_integration_tests",
"enabled":true,
"run_if":["dev/", "packages/flutter_tools/", "bin/"]
},
{
"name":"Linux web_tool_tests",
"repo":"flutter",
......@@ -298,6 +305,13 @@
"enabled":true,
"run_if":["dev/**", "packages/flutter_tools/**", "bin/**"]
},
{
"name":"Mac tool_integration_tests",
"repo":"flutter",
"task_name":"mac_tool_integration_tests",
"enabled":true,
"run_if":["dev/**", "packages/flutter_tools/**", "bin/**"]
},
{
"name":"Mac web_tool_tests",
"repo":"flutter",
......@@ -384,7 +398,15 @@
"name": "Windows tool_tests",
"repo": "flutter",
"task_name": "win_tool_tests",
"enabled":true
"enabled":true,
"run_if":["dev/**", "packages/flutter_tools/**", "bin/**"]
},
{
"name": "Windows tool_integration_tests",
"repo": "flutter",
"task_name": "win_tool_integration_tests",
"enabled":true,
"run_if":["dev/**", "packages/flutter_tools/**", "bin/**"]
},
{
"name": "Windows web_tool_tests",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment