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

Fail lazily when 1+ Skia gold comparions fail. #51010

Merged
merged 1 commit into from
Feb 27, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions testing/scenario_app/bin/run_android_tests.dart
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ Future<void> _run({
late final ServerSocket server;
final List<Future<void>> pendingComparisons = <Future<void>>[];
final List<Socket> pendingConnections = <Socket>[];
int comparisonsFailed = 0;
await step('Starting server...', () async {
server = await ServerSocket.bind(InternetAddress.anyIPv4, _tcpPort);
if (verbose) {
Expand Down Expand Up @@ -186,8 +187,9 @@ Future<void> _run({
if (isSkiaGoldClientAvailable) {
final Future<void> comparison = skiaGoldClient!
.addImg(fileName, goldenFile, screenshotSize: screenshot.pixelCount)
.catchError((dynamic err) {
panic(<String>['skia gold comparison failed: $err']);
.catchError((Object error) {
logWarning('skia gold comparison failed: $error');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure what was happening when you threw from an error handler block. Seems reasonable to try

comparisonsFailed++;
});
pendingComparisons.add(comparison);
}
Expand Down Expand Up @@ -346,6 +348,8 @@ Future<void> _run({
if (out.toString().contains('FAILURES!!!')) {
stdout.write(out);
panic(<String>['1 or more tests failed']);
} else if (comparisonsFailed > 0) {
panic(<String>['$comparisonsFailed Skia Gold comparisons failed']);
}
});
} finally {
Expand Down