File tree 2 files changed +23
-5
lines changed
flutter_goldens_client/lib
2 files changed +23
-5
lines changed Original file line number Diff line number Diff line change 4
4
5
5
import 'dart:async' ;
6
6
import 'dart:io' as io;
7
+ import 'dart:math' as math;
7
8
import 'dart:typed_data' ;
8
9
9
10
import 'package:file/file.dart' ;
@@ -130,15 +131,15 @@ abstract class FlutterGoldenFileComparator extends GoldenFileComparator {
130
131
/// Calculate the appropriate basedir for the current test context.
131
132
@protected
132
133
@visibleForTesting
133
- static Directory getBaseDirectory (LocalFileComparator defaultComparator, Platform platform) {
134
+ static Directory getBaseDirectory (LocalFileComparator defaultComparator, Platform platform, { String suffix = '' } ) {
134
135
const FileSystem fs = LocalFileSystem ();
135
136
final Directory flutterRoot = fs.directory (platform.environment[_kFlutterRootKey]);
136
137
final Directory comparisonRoot = flutterRoot.childDirectory (
137
138
fs.path.join (
138
139
'bin' ,
139
140
'cache' ,
140
141
'pkg' ,
141
- 'skia_goldens' ,
142
+ 'skia_goldens$ suffix ' ,
142
143
)
143
144
);
144
145
final Directory testDirectory = fs.directory (defaultComparator.basedir);
@@ -214,6 +215,7 @@ class FlutterSkiaGoldFileComparator extends FlutterGoldenFileComparator {
214
215
final Directory baseDirectory = FlutterGoldenFileComparator .getBaseDirectory (
215
216
defaultComparator,
216
217
platform,
218
+ suffix: '${math .Random ().nextInt (10000 )}' ,
217
219
);
218
220
219
221
if (! baseDirectory.existsSync ()) {
Original file line number Diff line number Diff line change @@ -121,10 +121,15 @@ class SkiaGoldClient {
121
121
.path,
122
122
];
123
123
124
- await io.Process .run (
124
+ final io. ProcessResult result = await io.Process .run (
125
125
_goldctl,
126
126
authArguments,
127
127
);
128
+
129
+ if (result.exitCode != 0 ) {
130
+ print ('goldctl auth stdout: ${result .stdout }' );
131
+ print ('goldctl auth stderr: ${result .stderr }' );
132
+ }
128
133
}
129
134
130
135
/// Executes the `imgtest init` command in the goldctl tool.
@@ -158,10 +163,15 @@ class SkiaGoldClient {
158
163
throw NonZeroExitCode (1 , buf.toString ());
159
164
}
160
165
161
- await io.Process .run (
166
+ final io. ProcessResult result = await io.Process .run (
162
167
_goldctl,
163
168
imgtestInitArguments,
164
169
);
170
+
171
+ if (result.exitCode != 0 ) {
172
+ print ('goldctl imgtest init stdout: ${result .stdout }' );
173
+ print ('goldctl imgtest init stderr: ${result .stderr }' );
174
+ }
165
175
}
166
176
167
177
/// Executes the `imgtest add` command in the goldctl tool.
@@ -186,10 +196,16 @@ class SkiaGoldClient {
186
196
'--png-file' , goldenFile.path,
187
197
];
188
198
189
- await io.Process .run (
199
+ final io. ProcessResult result = await io.Process .run (
190
200
_goldctl,
191
201
imgtestArguments,
192
202
);
203
+
204
+ if (result.exitCode != 0 ) {
205
+ print ('goldctl imgtest add stdout: ${result .stdout }' );
206
+ print ('goldctl imgtest add stderr: ${result .stderr }' );
207
+ }
208
+
193
209
return true ;
194
210
}
195
211
You can’t perform that action at this time.
0 commit comments