Move web integration tool tests to web.shard (#70226)

* Move web integration tool tests to web.shard

Web integration tool tests depend on DDC changes in SDK. This change
moves them to a separate shard and subshard so CI bot configurations
can run them separately.

In particular, with will allow running those tests on dart CI flutter
HHH web bot instead of a non-web one, allowing early detection and easy
classification of issues caused by SDK changes as VM- or Web related.

* Enabled verbose mode for flaky web_tool_tests

* Split out the test changes to be commited first
This commit is contained in:
Anna Gringauze
2020-11-11 15:42:15 -08:00
committed by GitHub
parent 153f3d23c3
commit edf26e756d
6 changed files with 61 additions and 17 deletions

View File

@@ -125,6 +125,7 @@ Future<void> main(List<String> args) async {
'framework_tests': _runFrameworkTests,
'tool_coverage': _runToolCoverage,
'tool_tests': _runToolTests,
'web_tool_tests': _runWebToolTests,
'web_tests': _runWebUnitTests,
'web_integration_tests': _runWebIntegrationTests,
'web_long_running_tests': _runWebLongRunningTests,
@@ -313,6 +314,7 @@ Future<void> _runToolCoverage() async {
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');
@@ -321,6 +323,7 @@ Future<void> _runToolTests() async {
.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 {
@@ -337,10 +340,27 @@ Future<void> _runToolTests() async {
);
},
);
// Prevent web tests from running if not explicitly requested.
if (Platform.environment[CIRRUS_TASK_NAME] == null) {
subshards.remove('web');
}
await selectSubshard(subshards);
}
Future<void> _runWebToolTests() 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 = <String, ShardRunner>{
kWeb:
() async {
await _pubRunTest(
toolsPath,
forceSingleCore: true,
testPaths: <String>[path.join(kTest, '$kWeb$kDotShard', '')],
enableFlutterToolAsserts: true,
);
}
};
await selectSubshard(subshards);
}