Fix Gold flake from gsutil fallback (#50149)
diff --git a/packages/flutter_goldens/test/flutter_goldens_test.dart b/packages/flutter_goldens/test/flutter_goldens_test.dart
index 96fb281..97be7b1 100644
--- a/packages/flutter_goldens/test/flutter_goldens_test.dart
+++ b/packages/flutter_goldens/test/flutter_goldens_test.dart
@@ -68,8 +68,9 @@
});
test('auth performs minimal work if already authorized', () async {
- fs.file('/workDirectory/temp/auth_opt.json')
+ final File authFile = fs.file('/workDirectory/temp/auth_opt.json')
..createSync(recursive: true);
+ authFile.writeAsStringSync(authTemplate());
when(process.run(any))
.thenAnswer((_) => Future<ProcessResult>
.value(ProcessResult(123, 0, '', '')));
@@ -81,6 +82,16 @@
));
});
+ test('gsutil is checked when authorization file is present', () async {
+ final File authFile = fs.file('/workDirectory/temp/auth_opt.json')
+ ..createSync(recursive: true);
+ authFile.writeAsStringSync(authTemplate(gsutil: true));
+ expect(
+ await skiaClient.clientIsAuthorized(),
+ isFalse,
+ );
+ });
+
test('throws for error state from auth', () async {
platform = FakePlatform(
environment: <String, String>{
@@ -110,7 +121,7 @@
);
});
- test(' throws for error state from init', () {
+ test('throws for error state from init', () {
platform = FakePlatform(
environment: <String, String>{
'FLUTTER_ROOT': _kFlutterRoot,
@@ -458,7 +469,7 @@
);
});
- test('calculates the basedir correctly from defaultComparator', () async {
+ test('calculates the basedir correctly from defaultComparator for local testing', () async {
final MockLocalFileComparator defaultComparator = MockLocalFileComparator();
final Directory flutterRoot = fs.directory(platform.environment['FLUTTER_ROOT'])
..createSync(recursive: true);
@@ -467,6 +478,7 @@
final Directory basedir = FlutterGoldenFileComparator.getBaseDirectory(
defaultComparator,
platform,
+ local: true,
);
expect(
basedir.uri,