Unverified Commit 1374a413 authored by Kate Lovett's avatar Kate Lovett Committed by GitHub

Provide debug output for Gold uploads on post-submit (#45704)

parent e4b809b7
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
import 'dart:async'; import 'dart:async';
import 'dart:io' as io; import 'dart:io' as io;
import 'dart:math' as math;
import 'dart:typed_data'; import 'dart:typed_data';
import 'package:file/file.dart'; import 'package:file/file.dart';
...@@ -130,7 +131,7 @@ abstract class FlutterGoldenFileComparator extends GoldenFileComparator { ...@@ -130,7 +131,7 @@ abstract class FlutterGoldenFileComparator extends GoldenFileComparator {
/// Calculate the appropriate basedir for the current test context. /// Calculate the appropriate basedir for the current test context.
@protected @protected
@visibleForTesting @visibleForTesting
static Directory getBaseDirectory(LocalFileComparator defaultComparator, Platform platform) { static Directory getBaseDirectory(LocalFileComparator defaultComparator, Platform platform, {String suffix = ''}) {
const FileSystem fs = LocalFileSystem(); const FileSystem fs = LocalFileSystem();
final Directory flutterRoot = fs.directory(platform.environment[_kFlutterRootKey]); final Directory flutterRoot = fs.directory(platform.environment[_kFlutterRootKey]);
final Directory comparisonRoot = flutterRoot.childDirectory( final Directory comparisonRoot = flutterRoot.childDirectory(
...@@ -138,7 +139,7 @@ abstract class FlutterGoldenFileComparator extends GoldenFileComparator { ...@@ -138,7 +139,7 @@ abstract class FlutterGoldenFileComparator extends GoldenFileComparator {
'bin', 'bin',
'cache', 'cache',
'pkg', 'pkg',
'skia_goldens', 'skia_goldens$suffix',
) )
); );
final Directory testDirectory = fs.directory(defaultComparator.basedir); final Directory testDirectory = fs.directory(defaultComparator.basedir);
...@@ -214,6 +215,7 @@ class FlutterSkiaGoldFileComparator extends FlutterGoldenFileComparator { ...@@ -214,6 +215,7 @@ class FlutterSkiaGoldFileComparator extends FlutterGoldenFileComparator {
final Directory baseDirectory = FlutterGoldenFileComparator.getBaseDirectory( final Directory baseDirectory = FlutterGoldenFileComparator.getBaseDirectory(
defaultComparator, defaultComparator,
platform, platform,
suffix: '${math.Random().nextInt(10000)}',
); );
if(!baseDirectory.existsSync()) { if(!baseDirectory.existsSync()) {
......
...@@ -121,10 +121,15 @@ class SkiaGoldClient { ...@@ -121,10 +121,15 @@ class SkiaGoldClient {
.path, .path,
]; ];
await io.Process.run( final io.ProcessResult result = await io.Process.run(
_goldctl, _goldctl,
authArguments, authArguments,
); );
if (result.exitCode != 0) {
print('goldctl auth stdout: ${result.stdout}');
print('goldctl auth stderr: ${result.stderr}');
}
} }
/// Executes the `imgtest init` command in the goldctl tool. /// Executes the `imgtest init` command in the goldctl tool.
...@@ -158,10 +163,15 @@ class SkiaGoldClient { ...@@ -158,10 +163,15 @@ class SkiaGoldClient {
throw NonZeroExitCode(1, buf.toString()); throw NonZeroExitCode(1, buf.toString());
} }
await io.Process.run( final io.ProcessResult result = await io.Process.run(
_goldctl, _goldctl,
imgtestInitArguments, imgtestInitArguments,
); );
if (result.exitCode != 0) {
print('goldctl imgtest init stdout: ${result.stdout}');
print('goldctl imgtest init stderr: ${result.stderr}');
}
} }
/// Executes the `imgtest add` command in the goldctl tool. /// Executes the `imgtest add` command in the goldctl tool.
...@@ -186,10 +196,16 @@ class SkiaGoldClient { ...@@ -186,10 +196,16 @@ class SkiaGoldClient {
'--png-file', goldenFile.path, '--png-file', goldenFile.path,
]; ];
await io.Process.run( final io.ProcessResult result = await io.Process.run(
_goldctl, _goldctl,
imgtestArguments, imgtestArguments,
); );
if (result.exitCode != 0) {
print('goldctl imgtest add stdout: ${result.stdout}');
print('goldctl imgtest add stderr: ${result.stderr}');
}
return true; return true;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment