[web] small felt fixes in compile and run sub-commands (flutter/engine#32304)
This commit is contained in:
@@ -212,7 +212,7 @@ Future<void> compileTests(List<FilePath> testFiles) async {
|
||||
}
|
||||
|
||||
// Maximum number of concurrent dart2js processes to use.
|
||||
const int _dart2jsConcurrency = int.fromEnvironment('FELT_DART2JS_CONCURRENCY', defaultValue: 8);
|
||||
int _dart2jsConcurrency = int.parse(io.Platform.environment['FELT_DART2JS_CONCURRENCY'] ?? '8');
|
||||
|
||||
final Pool _dart2jsPool = Pool(_dart2jsConcurrency);
|
||||
|
||||
|
||||
@@ -51,17 +51,6 @@ class RunTestsStep implements PipelineStep {
|
||||
|
||||
final BrowserEnvironment _browserEnvironment;
|
||||
|
||||
/// Global list of shards that failed.
|
||||
///
|
||||
/// This is used to make sure that when there's a test failure anywhere we
|
||||
/// exit with a non-zero exit code.
|
||||
///
|
||||
/// Shards must never be removed from this list, only added.
|
||||
List<String> failedShards = <String>[];
|
||||
|
||||
/// Whether all test shards succeeded.
|
||||
bool get allShardsPassed => failedShards.isEmpty;
|
||||
|
||||
@override
|
||||
String get description => 'run_tests';
|
||||
|
||||
@@ -88,29 +77,12 @@ class RunTestsStep implements PipelineStep {
|
||||
skiaClient: skiaClient,
|
||||
overridePathToCanvasKit: overridePathToCanvasKit,
|
||||
);
|
||||
_checkExitCode('Unit tests');
|
||||
|
||||
if (!allShardsPassed) {
|
||||
throw ToolExit(_createFailedShardsMessage());
|
||||
}
|
||||
}
|
||||
|
||||
void _checkExitCode(String shard) {
|
||||
if (io.exitCode != 0) {
|
||||
failedShards.add(shard);
|
||||
throw ToolExit('Some tests failed');
|
||||
}
|
||||
}
|
||||
|
||||
String _createFailedShardsMessage() {
|
||||
final StringBuffer message = StringBuffer(
|
||||
'The following test shards failed:\n',
|
||||
);
|
||||
for (final String failedShard in failedShards) {
|
||||
message.writeln(' - $failedShard');
|
||||
}
|
||||
return message.toString();
|
||||
}
|
||||
|
||||
Future<SkiaGoldClient?> _createSkiaClient() async {
|
||||
final SkiaGoldClient skiaClient = SkiaGoldClient(
|
||||
environment.webUiSkiaGoldDirectory,
|
||||
|
||||
Reference in New Issue
Block a user