Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit 83c7431

Browse files
Yegor's comments.
1 parent 9c4508b commit 83c7431

File tree

4 files changed

+51
-20
lines changed

4 files changed

+51
-20
lines changed

lib/web_ui/dev/felt_config.dart

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,10 @@ class ArtifactDependencies {
6666
required this.skwasm
6767
});
6868

69-
ArtifactDependencies.none()
70-
: canvasKit = false
71-
, canvasKitChromium = false
72-
, skwasm = false;
69+
ArtifactDependencies.none() :
70+
canvasKit = false,
71+
canvasKitChromium = false,
72+
skwasm = false;
7373
final bool canvasKit;
7474
final bool canvasKitChromium;
7575
final bool skwasm;
@@ -214,19 +214,16 @@ class FeltConfig {
214214
throw AssertionError('Artifact dep $dep listed twice in suite $name.');
215215
}
216216
canvasKit = true;
217-
break;
218217
case 'canvaskit_chromium':
219218
if (canvasKitChromium) {
220219
throw AssertionError('Artifact dep $dep listed twice in suite $name.');
221220
}
222221
canvasKitChromium = true;
223-
break;
224222
case 'skwasm':
225223
if (skwasm) {
226224
throw AssertionError('Artifact dep $dep listed twice in suite $name.');
227225
}
228226
skwasm = true;
229-
break;
230227
default:
231228
throw AssertionError('Unrecognized artifact dependency: $dep');
232229
}

lib/web_ui/dev/pipeline.dart

Lines changed: 27 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import 'dart:io' as io;
88
import 'package:path/path.dart' as path;
99
import 'package:watcher/watcher.dart';
1010

11+
import 'exceptions.dart';
1112
import 'utils.dart';
1213

1314
/// Describes what [Pipeline] is currently doing.
@@ -87,6 +88,13 @@ abstract class ProcessStep implements PipelineStep {
8788
}
8889
}
8990

91+
class _PipelineStepFailure {
92+
_PipelineStepFailure(this.step, this.error);
93+
94+
final PipelineStep step;
95+
final Object error;
96+
}
97+
9098
/// Executes a sequence of asynchronous tasks, typically as part of a build/test
9199
/// process.
92100
///
@@ -112,27 +120,34 @@ class Pipeline {
112120
///
113121
/// Returns a future that resolves after all steps have been performed.
114122
///
115-
/// The future resolves to an error as soon as any of the steps fails.
123+
/// If any steps fail, the pipeline attempts to continue to subsequent steps,
124+
/// but will fail at the end.
116125
///
117126
/// The pipeline may be interrupted by calling [stop] before the future
118127
/// resolves.
119128
Future<void> run() async {
120129
_status = PipelineStatus.started;
121-
try {
122-
for (final PipelineStep step in steps) {
123-
if (status != PipelineStatus.started) {
124-
break;
125-
}
126-
_currentStep = step;
127-
_currentStepFuture = step.run();
130+
final List<_PipelineStepFailure> failures = <_PipelineStepFailure>[];
131+
for (final PipelineStep step in steps) {
132+
_currentStep = step;
133+
_currentStepFuture = step.run();
134+
try {
128135
await _currentStepFuture;
136+
} catch (e) {
137+
failures.add(_PipelineStepFailure(step, e));
138+
} finally {
139+
_currentStep = null;
129140
}
141+
}
142+
if (failures.isEmpty) {
130143
_status = PipelineStatus.done;
131-
} catch (_) {
144+
} else {
132145
_status = PipelineStatus.error;
133-
rethrow;
134-
} finally {
135-
_currentStep = null;
146+
print('Pipeline experienced the following failures:');
147+
for (final _PipelineStepFailure failure in failures) {
148+
print(' "${failure.step.description}": ${failure.error}');
149+
}
150+
throw ToolExit('Test pipeline failed.');
136151
}
137152
}
138153

lib/web_ui/dev/steps/compile_bundle_step.dart

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,22 @@ class CompileBundleStep implements PipelineStep {
131131
'results.json',
132132
));
133133
outputResultsFile.writeAsStringSync(resultsJson);
134-
print('\rCompleted compilation of ${bundle.name.ansiMagenta} in ${stopwatch.elapsedMilliseconds}ms.'.padRight(82));
134+
final List<String> failedFiles = <String>[];
135+
results.forEach((String fileName, CompileResult result) {
136+
if (result == CompileResult.compilationFailure) {
137+
failedFiles.add(fileName);
138+
}
139+
});
140+
if (failedFiles.isEmpty) {
141+
print('\rCompleted compilation of ${bundle.name.ansiMagenta} in ${stopwatch.elapsedMilliseconds}ms.'.padRight(82));
142+
} else {
143+
print('\rThe bundle ${bundle.name.ansiMagenta} compiled with some failures in ${stopwatch.elapsedMilliseconds}ms.');
144+
print('Compilation failures:');
145+
for (final String fileName in failedFiles) {
146+
print(' $fileName');
147+
}
148+
throw ToolExit('Failed to compile ${bundle.name.ansiMagenta}.');
149+
}
135150
}
136151
}
137152

@@ -210,6 +225,7 @@ class Dart2JSCompiler extends TestCompiler {
210225
environment.dartExecutable,
211226
arguments,
212227
workingDirectory: inputTestSetDirectory.path,
228+
failureIsSuccess: true,
213229
evalOutput: !isVerbose,
214230
);
215231
final int exitCode = await process.wait();
@@ -276,6 +292,7 @@ class Dart2WasmCompiler extends TestCompiler {
276292
environment.dartAotRuntimePath,
277293
arguments,
278294
workingDirectory: inputTestSetDirectory.path,
295+
failureIsSuccess: true,
279296
evalOutput: true,
280297
);
281298
final int exitCode = await process.wait();

lib/web_ui/test/felt_config.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# See the `README.md` in this directory for documentation on the structure of
2+
# this file.
13
compile-configs:
24
- name: dart2js-html
35
compiler: dart2js

0 commit comments

Comments
 (0)