From 2386fd90c9435919796c43aaab4c8cfa2f175b74 Mon Sep 17 00:00:00 2001 From: Kate Lovett Date: Thu, 17 Mar 2022 17:07:02 -0500 Subject: [PATCH] Disable post-submit Gold failures entirely (#100332) --- .../test/flutter_goldens_test.dart | 84 ++++++++++--------- .../lib/skia_client.dart | 11 ++- 2 files changed, 52 insertions(+), 43 deletions(-) diff --git a/packages/flutter_goldens/test/flutter_goldens_test.dart b/packages/flutter_goldens/test/flutter_goldens_test.dart index bc7ab23ba2..c920be4c38 100644 --- a/packages/flutter_goldens/test/flutter_goldens_test.dart +++ b/packages/flutter_goldens/test/flutter_goldens_test.dart @@ -181,7 +181,9 @@ void main() { '--commit', '1234', '--keys-file', '/workDirectory/keys.json', '--failure-file', '/workDirectory/failures.json', - '--passfail', + // TODO(Piinks): Re-enable once https://github.com/flutter/flutter/issues/100304 + // is resolved. + //'--passfail', ], null, ); @@ -257,46 +259,46 @@ void main() { await skiaClient.tryjobInit(); }); - test('throws for error state from imgtestAdd', () { - final File goldenFile = fs.file('/workDirectory/temp/golden_file_test.png') - ..createSync(recursive: true); - platform = FakePlatform( - environment: { - 'FLUTTER_ROOT': _kFlutterRoot, - 'GOLDCTL' : 'goldctl', - }, - operatingSystem: 'macos' - ); - - skiaClient = SkiaGoldClient( - workDirectory, - fs: fs, - process: process, - platform: platform, - httpClient: fakeHttpClient, - ); - - const RunInvocation goldctlInvocation = RunInvocation( - [ - 'goldctl', - 'imgtest', 'add', - '--work-dir', '/workDirectory/temp', - '--test-name', 'golden_file_test', - '--png-file', '/workDirectory/temp/golden_file_test.png', - // TODO(Piinks): Re-enable once https://github.com/flutter/flutter/issues/100304 - // is resolved. - //'--passfail', - ], - null, - ); - process.processResults[goldctlInvocation] = ProcessResult(123, 1, 'Expected failure', 'Expected failure'); - process.fallbackProcessResult = ProcessResult(123, 1, 'Fallback failure', 'Fallback failure'); - - expect( - skiaClient.imgtestAdd('golden_file_test', goldenFile), - throwsException, - ); - }); + // TODO(Piinks): Re-enable once https://github.com/flutter/flutter/issues/100304 + // is resolved. + // test('throws for error state from imgtestAdd', () { + // final File goldenFile = fs.file('/workDirectory/temp/golden_file_test.png') + // ..createSync(recursive: true); + // platform = FakePlatform( + // environment: { + // 'FLUTTER_ROOT': _kFlutterRoot, + // 'GOLDCTL' : 'goldctl', + // }, + // operatingSystem: 'macos' + // ); + // + // skiaClient = SkiaGoldClient( + // workDirectory, + // fs: fs, + // process: process, + // platform: platform, + // httpClient: fakeHttpClient, + // ); + // + // const RunInvocation goldctlInvocation = RunInvocation( + // [ + // 'goldctl', + // 'imgtest', 'add', + // '--work-dir', '/workDirectory/temp', + // '--test-name', 'golden_file_test', + // '--png-file', '/workDirectory/temp/golden_file_test.png', + // '--passfail', + // ], + // null, + // ); + // process.processResults[goldctlInvocation] = ProcessResult(123, 1, 'Expected failure', 'Expected failure'); + // process.fallbackProcessResult = ProcessResult(123, 1, 'Fallback failure', 'Fallback failure'); + // + // expect( + // skiaClient.imgtestAdd('golden_file_test', goldenFile), + // throwsException, + // ); + // }); test('correctly inits tryjob for luci', () async { platform = FakePlatform( diff --git a/packages/flutter_goldens_client/lib/skia_client.dart b/packages/flutter_goldens_client/lib/skia_client.dart index a0e85cf0a5..9b9a24631d 100644 --- a/packages/flutter_goldens_client/lib/skia_client.dart +++ b/packages/flutter_goldens_client/lib/skia_client.dart @@ -144,7 +144,9 @@ class SkiaGoldClient { '--commit', commitHash, '--keys-file', keys.path, '--failure-file', failures.path, - '--passfail', + // TODO(Piinks): Re-enable once https://github.com/flutter/flutter/issues/100304 + // is resolved. + //'--passfail', ]; if (imgtestInitCommand.contains(null)) { @@ -214,7 +216,12 @@ class SkiaGoldClient { ..writeln('Debug information for Gold:') ..writeln('stdout: ${result.stdout}') ..writeln('stderr: ${result.stderr}'); - throw Exception(buf.toString()); + // Temporarily print logs for issue diagnosis + // ignore: avoid_print + print(buf.toString()); + // TODO(Piinks): Re-enable once https://github.com/flutter/flutter/issues/100304 + // is resolved. + // throw Exception(buf.toString()); } return true;