Unverified Commit 1747adb6 authored by Dan Field's avatar Dan Field Committed by GitHub

Drop mockito for flutter_goldens (#74782)

parent fe921211
...@@ -30,7 +30,4 @@ dependencies: ...@@ -30,7 +30,4 @@ dependencies:
test_api: 0.2.19-nullsafety.6 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade" test_api: 0.2.19-nullsafety.6 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
vector_math: 2.1.0-nullsafety.5 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade" vector_math: 2.1.0-nullsafety.5 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
dev_dependencies: # PUBSPEC CHECKSUM: ae8f
mockito: 4.1.1
# PUBSPEC CHECKSUM: 49d5
...@@ -79,7 +79,8 @@ class SkiaGoldClient { ...@@ -79,7 +79,8 @@ class SkiaGoldClient {
Future<void> auth() async { Future<void> auth() async {
if (await clientIsAuthorized()) if (await clientIsAuthorized())
return; return;
final List<String> authArguments = <String>[ final List<String> authCommand = <String>[
_goldctl,
'auth', 'auth',
'--work-dir', workDirectory '--work-dir', workDirectory
.childDirectory('temp') .childDirectory('temp')
...@@ -87,10 +88,7 @@ class SkiaGoldClient { ...@@ -87,10 +88,7 @@ class SkiaGoldClient {
'--luci', '--luci',
]; ];
final io.ProcessResult result = await io.Process.run( final io.ProcessResult result = await process.run(authCommand);
_goldctl,
authArguments,
);
if (result.exitCode != 0) { if (result.exitCode != 0) {
final StringBuffer buf = StringBuffer() final StringBuffer buf = StringBuffer()
...@@ -118,7 +116,8 @@ class SkiaGoldClient { ...@@ -118,7 +116,8 @@ class SkiaGoldClient {
await failures.create(); await failures.create();
final String commitHash = await _getCurrentCommit(); final String commitHash = await _getCurrentCommit();
final List<String> imgtestInitArguments = <String>[ final List<String> imgtestInitCommand = <String>[
_goldctl,
'imgtest', 'init', 'imgtest', 'init',
'--instance', 'flutter', '--instance', 'flutter',
'--work-dir', workDirectory '--work-dir', workDirectory
...@@ -130,19 +129,16 @@ class SkiaGoldClient { ...@@ -130,19 +129,16 @@ class SkiaGoldClient {
'--passfail', '--passfail',
]; ];
if (imgtestInitArguments.contains(null)) { if (imgtestInitCommand.contains(null)) {
final StringBuffer buf = StringBuffer() final StringBuffer buf = StringBuffer()
..writeln('A null argument was provided for Skia Gold imgtest init.') ..writeln('A null argument was provided for Skia Gold imgtest init.')
..writeln('Please confirm the settings of your golden file test.') ..writeln('Please confirm the settings of your golden file test.')
..writeln('Arguments provided:'); ..writeln('Arguments provided:');
imgtestInitArguments.forEach(buf.writeln); imgtestInitCommand.forEach(buf.writeln);
throw Exception(buf.toString()); throw Exception(buf.toString());
} }
final io.ProcessResult result = await io.Process.run( final io.ProcessResult result = await process.run(imgtestInitCommand);
_goldctl,
imgtestInitArguments,
);
if (result.exitCode != 0) { if (result.exitCode != 0) {
final StringBuffer buf = StringBuffer() final StringBuffer buf = StringBuffer()
...@@ -167,7 +163,8 @@ class SkiaGoldClient { ...@@ -167,7 +163,8 @@ class SkiaGoldClient {
/// The [testName] and [goldenFile] parameters reference the current /// The [testName] and [goldenFile] parameters reference the current
/// comparison being evaluated by the [FlutterPostSubmitFileComparator]. /// comparison being evaluated by the [FlutterPostSubmitFileComparator].
Future<bool> imgtestAdd(String testName, File goldenFile) async { Future<bool> imgtestAdd(String testName, File goldenFile) async {
final List<String> imgtestArguments = <String>[ final List<String> imgtestCommand = <String>[
_goldctl,
'imgtest', 'add', 'imgtest', 'add',
'--work-dir', workDirectory '--work-dir', workDirectory
.childDirectory('temp') .childDirectory('temp')
...@@ -176,10 +173,7 @@ class SkiaGoldClient { ...@@ -176,10 +173,7 @@ class SkiaGoldClient {
'--png-file', goldenFile.path, '--png-file', goldenFile.path,
]; ];
final io.ProcessResult result = await io.Process.run( final io.ProcessResult result = await process.run(imgtestCommand);
_goldctl,
imgtestArguments,
);
if (result.exitCode != 0) { if (result.exitCode != 0) {
// We do not want to throw for non-zero exit codes here, as an intentional // We do not want to throw for non-zero exit codes here, as an intentional
...@@ -205,7 +199,8 @@ class SkiaGoldClient { ...@@ -205,7 +199,8 @@ class SkiaGoldClient {
await failures.create(); await failures.create();
final String commitHash = await _getCurrentCommit(); final String commitHash = await _getCurrentCommit();
final List<String> imgtestInitArguments = <String>[ final List<String> imgtestInitCommand = <String>[
_goldctl,
'imgtest', 'init', 'imgtest', 'init',
'--instance', 'flutter', '--instance', 'flutter',
'--work-dir', workDirectory '--work-dir', workDirectory
...@@ -220,19 +215,16 @@ class SkiaGoldClient { ...@@ -220,19 +215,16 @@ class SkiaGoldClient {
...getCIArguments(), ...getCIArguments(),
]; ];
if (imgtestInitArguments.contains(null)) { if (imgtestInitCommand.contains(null)) {
final StringBuffer buf = StringBuffer() final StringBuffer buf = StringBuffer()
..writeln('A null argument was provided for Skia Gold tryjob init.') ..writeln('A null argument was provided for Skia Gold tryjob init.')
..writeln('Please confirm the settings of your golden file test.') ..writeln('Please confirm the settings of your golden file test.')
..writeln('Arguments provided:'); ..writeln('Arguments provided:');
imgtestInitArguments.forEach(buf.writeln); imgtestInitCommand.forEach(buf.writeln);
throw Exception(buf.toString()); throw Exception(buf.toString());
} }
final io.ProcessResult result = await io.Process.run( final io.ProcessResult result = await process.run(imgtestInitCommand);
_goldctl,
imgtestInitArguments,
);
if (result.exitCode != 0) { if (result.exitCode != 0) {
final StringBuffer buf = StringBuffer() final StringBuffer buf = StringBuffer()
...@@ -257,7 +249,8 @@ class SkiaGoldClient { ...@@ -257,7 +249,8 @@ class SkiaGoldClient {
/// The [testName] and [goldenFile] parameters reference the current /// The [testName] and [goldenFile] parameters reference the current
/// comparison being evaluated by the [FlutterPreSubmitFileComparator]. /// comparison being evaluated by the [FlutterPreSubmitFileComparator].
Future<void> tryjobAdd(String testName, File goldenFile) async { Future<void> tryjobAdd(String testName, File goldenFile) async {
final List<String> imgtestArguments = <String>[ final List<String> imgtestCommand = <String>[
_goldctl,
'imgtest', 'add', 'imgtest', 'add',
'--work-dir', workDirectory '--work-dir', workDirectory
.childDirectory('temp') .childDirectory('temp')
...@@ -266,10 +259,7 @@ class SkiaGoldClient { ...@@ -266,10 +259,7 @@ class SkiaGoldClient {
'--png-file', goldenFile.path, '--png-file', goldenFile.path,
]; ];
final io.ProcessResult result = await io.Process.run( final io.ProcessResult result = await process.run(imgtestCommand);
_goldctl,
imgtestArguments,
);
final String/*!*/ resultStdout = result.stdout.toString(); final String/*!*/ resultStdout = result.stdout.toString();
if (result.exitCode != 0 && if (result.exitCode != 0 &&
......
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