@@ -177,17 +177,28 @@ class SkiaGoldClient {
177177 .path,
178178 '--test-name' , cleanTestName (testName),
179179 '--png-file' , goldenFile.path,
180+ '--passfail' ,
180181 ];
181182
182183 final io.ProcessResult result = await process.run (imgtestCommand);
183184
184185 if (result.exitCode != 0 ) {
185- // We do not want to throw for non-zero exit codes here, as an intentional
186- // change or new golden file test expect non-zero exit codes. Logging here
187- // is meant to help debugging in CI when an unexpected result occurs.
188- // See also: https://github.com/flutter/flutter/issues/91285
189- print ('goldctl imgtest add stdout: ${result .stdout }' ); // ignore: avoid_print
190- print ('goldctl imgtest add stderr: ${result .stderr }' ); // ignore: avoid_print
186+ // If an unapproved image has made it to post-submit, throw to close the
187+ // tree.
188+ final StringBuffer buf = StringBuffer ()
189+ ..writeln ('Skia Gold received an unapproved image in post-submit ' )
190+ ..writeln ('testing. Golden file images in flutter/flutter are triaged ' )
191+ ..writeln ('in pre-submit during code review for the given PR.' )
192+ ..writeln ()
193+ ..writeln ('Visit https://flutter-gold.skia.org/ to view and approve ' )
194+ ..writeln ('the image(s), or revert the associated change. For more ' )
195+ ..writeln ('information, visit the wiki: ' )
196+ ..writeln ('https://github.com/flutter/flutter/wiki/Writing-a-golden-file-test-for-package:flutter' )
197+ ..writeln ()
198+ ..writeln ('Debug information for Gold:' )
199+ ..writeln ('stdout: ${result .stdout }' )
200+ ..writeln ('stderr: ${result .stderr }' );
201+ throw Exception (buf.toString ());
191202 }
192203
193204 return true ;
0 commit comments