Provide debug output for Gold uploads on post-submit (#45704)
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
|
||||
import 'dart:async';
|
||||
import 'dart:io' as io;
|
||||
import 'dart:math' as math;
|
||||
import 'dart:typed_data';
|
||||
|
||||
import 'package:file/file.dart';
|
||||
@@ -130,7 +131,7 @@ abstract class FlutterGoldenFileComparator extends GoldenFileComparator {
|
||||
/// Calculate the appropriate basedir for the current test context.
|
||||
@protected
|
||||
@visibleForTesting
|
||||
static Directory getBaseDirectory(LocalFileComparator defaultComparator, Platform platform) {
|
||||
static Directory getBaseDirectory(LocalFileComparator defaultComparator, Platform platform, {String suffix = ''}) {
|
||||
const FileSystem fs = LocalFileSystem();
|
||||
final Directory flutterRoot = fs.directory(platform.environment[_kFlutterRootKey]);
|
||||
final Directory comparisonRoot = flutterRoot.childDirectory(
|
||||
@@ -138,7 +139,7 @@ abstract class FlutterGoldenFileComparator extends GoldenFileComparator {
|
||||
'bin',
|
||||
'cache',
|
||||
'pkg',
|
||||
'skia_goldens',
|
||||
'skia_goldens$suffix',
|
||||
)
|
||||
);
|
||||
final Directory testDirectory = fs.directory(defaultComparator.basedir);
|
||||
@@ -214,6 +215,7 @@ class FlutterSkiaGoldFileComparator extends FlutterGoldenFileComparator {
|
||||
final Directory baseDirectory = FlutterGoldenFileComparator.getBaseDirectory(
|
||||
defaultComparator,
|
||||
platform,
|
||||
suffix: '${math.Random().nextInt(10000)}',
|
||||
);
|
||||
|
||||
if(!baseDirectory.existsSync()) {
|
||||
|
||||
@@ -121,10 +121,15 @@ class SkiaGoldClient {
|
||||
.path,
|
||||
];
|
||||
|
||||
await io.Process.run(
|
||||
final io.ProcessResult result = await io.Process.run(
|
||||
_goldctl,
|
||||
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.
|
||||
@@ -158,10 +163,15 @@ class SkiaGoldClient {
|
||||
throw NonZeroExitCode(1, buf.toString());
|
||||
}
|
||||
|
||||
await io.Process.run(
|
||||
final io.ProcessResult result = await io.Process.run(
|
||||
_goldctl,
|
||||
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.
|
||||
@@ -186,10 +196,16 @@ class SkiaGoldClient {
|
||||
'--png-file', goldenFile.path,
|
||||
];
|
||||
|
||||
await io.Process.run(
|
||||
final io.ProcessResult result = await io.Process.run(
|
||||
_goldctl,
|
||||
imgtestArguments,
|
||||
);
|
||||
|
||||
if (result.exitCode != 0) {
|
||||
print('goldctl imgtest add stdout: ${result.stdout}');
|
||||
print('goldctl imgtest add stderr: ${result.stderr}');
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user