Add a throw statement for imgtestAdd non 0 exit codes. (flutter/engine#50829)

Thanks @Piinks for noticing.
This commit is contained in:
Matan Lurey 2024-02-21 11:51:02 -08:00 committed by GitHub
parent c70da350fe
commit a890ef28e6

View File

@ -257,11 +257,20 @@ class SkiaGoldClient {
final ProcessResult result = await _runCommand(imgtestCommand);
if (result.exitCode != 0) {
// We do not want to throw for non-zero exit codes here, as an intentional
// change or new golden file test expect non-zero exit codes. Logging here
// is meant to inform when an unexpected result occurs.
print('goldctl imgtest add stdout: ${result.stdout}');
print('goldctl imgtest add stderr: ${result.stderr}');
final StringBuffer buf = StringBuffer()
..writeln('Skia Gold received an unapproved image in post-submit ')
..writeln('testing. Golden file images in flutter/engine are triaged ')
..writeln('in pre-submit during code review for the given PR.')
..writeln()
..writeln('Visit https://flutter-engine-gold.skia.org/ to view and approve ')
..writeln('the image(s), or revert the associated change. For more ')
..writeln('information, visit the wiki: ')
..writeln('https://github.com/flutter/flutter/wiki/Writing-a-golden-file-test-for-package:flutter')
..writeln()
..writeln('Debug information for Gold --------------------------------')
..writeln('stdout: ${result.stdout}')
..writeln('stderr: ${result.stderr}');
throw Exception(buf.toString());
} else if (verbose) {
print('stdout:\n${result.stdout}');
print('stderr:\n${result.stderr}');