Rewrap some lines that are about to get much longer. (#146803)
This is part 10 of a broken down version of the #140101 refactor. This will make future PRs easier to review.
This commit is contained in:
@@ -42,9 +42,19 @@ Future<void> testExecutable(FutureOr<void> Function() testMain, {String? namePre
|
||||
const Platform platform = LocalPlatform();
|
||||
const FileSystem fs = LocalFileSystem();
|
||||
if (FlutterPostSubmitFileComparator.isForEnvironment(platform)) {
|
||||
goldenFileComparator = await FlutterPostSubmitFileComparator.fromDefaultComparator(platform, namePrefix: namePrefix, log: print, fs: fs);
|
||||
goldenFileComparator = await FlutterPostSubmitFileComparator.fromDefaultComparator(
|
||||
platform,
|
||||
namePrefix: namePrefix,
|
||||
log: print,
|
||||
fs: fs,
|
||||
);
|
||||
} else if (FlutterPreSubmitFileComparator.isForEnvironment(platform)) {
|
||||
goldenFileComparator = await FlutterPreSubmitFileComparator.fromDefaultComparator(platform, namePrefix: namePrefix, log: print, fs: fs);
|
||||
goldenFileComparator = await FlutterPreSubmitFileComparator.fromDefaultComparator(
|
||||
platform,
|
||||
namePrefix: namePrefix,
|
||||
log: print,
|
||||
fs: fs,
|
||||
);
|
||||
} else if (FlutterSkippingFileComparator.isForEnvironment(platform)) {
|
||||
goldenFileComparator = FlutterSkippingFileComparator.fromDefaultComparator(
|
||||
'Golden file testing is not executed on Cirrus, or LUCI environments '
|
||||
@@ -55,7 +65,11 @@ Future<void> testExecutable(FutureOr<void> Function() testMain, {String? namePre
|
||||
fs: fs,
|
||||
);
|
||||
} else {
|
||||
goldenFileComparator = await FlutterLocalFileComparator.fromDefaultComparator(platform, log: print, fs: fs);
|
||||
goldenFileComparator = await FlutterLocalFileComparator.fromDefaultComparator(
|
||||
platform,
|
||||
log: print,
|
||||
fs: fs,
|
||||
);
|
||||
}
|
||||
await testMain();
|
||||
}
|
||||
@@ -251,7 +265,6 @@ class FlutterPostSubmitFileComparator extends FlutterGoldenFileComparator {
|
||||
required LogCallback log,
|
||||
required FileSystem fs,
|
||||
}) async {
|
||||
|
||||
defaultComparator ??= goldenFileComparator as LocalFileComparator;
|
||||
final Directory baseDirectory = FlutterGoldenFileComparator.getBaseDirectory(
|
||||
defaultComparator,
|
||||
@@ -263,7 +276,13 @@ class FlutterPostSubmitFileComparator extends FlutterGoldenFileComparator {
|
||||
|
||||
goldens ??= SkiaGoldClient(baseDirectory, log: log);
|
||||
await goldens.auth();
|
||||
return FlutterPostSubmitFileComparator(baseDirectory.uri, goldens, namePrefix: namePrefix, log: log, fs: fs);
|
||||
return FlutterPostSubmitFileComparator(
|
||||
baseDirectory.uri,
|
||||
goldens,
|
||||
namePrefix: namePrefix,
|
||||
log: log,
|
||||
fs: fs,
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -272,7 +291,6 @@ class FlutterPostSubmitFileComparator extends FlutterGoldenFileComparator {
|
||||
golden = _addPrefix(golden);
|
||||
await update(golden, imageBytes);
|
||||
final File goldenFile = getGoldenFile(golden);
|
||||
|
||||
return skiaClient.imgtestAdd(golden.path, goldenFile);
|
||||
}
|
||||
|
||||
@@ -285,7 +303,6 @@ class FlutterPostSubmitFileComparator extends FlutterGoldenFileComparator {
|
||||
&& !platform.environment.containsKey('GOLD_TRYJOB')
|
||||
// Only run on main branch.
|
||||
&& _isMainBranch(platform.environment['GIT_BRANCH']);
|
||||
|
||||
return luciPostSubmit;
|
||||
}
|
||||
}
|
||||
@@ -333,7 +350,6 @@ class FlutterPreSubmitFileComparator extends FlutterGoldenFileComparator {
|
||||
required LogCallback log,
|
||||
required FileSystem fs,
|
||||
}) async {
|
||||
|
||||
defaultComparator ??= goldenFileComparator as LocalFileComparator;
|
||||
final Directory baseDirectory = testBasedir ?? FlutterGoldenFileComparator.getBaseDirectory(
|
||||
defaultComparator,
|
||||
@@ -427,7 +443,14 @@ class FlutterSkippingFileComparator extends FlutterGoldenFileComparator {
|
||||
defaultComparator ??= goldenFileComparator as LocalFileComparator;
|
||||
final Uri basedir = defaultComparator.basedir;
|
||||
final SkiaGoldClient skiaClient = SkiaGoldClient(fs.directory(basedir), log: log);
|
||||
return FlutterSkippingFileComparator(basedir, skiaClient, reason, namePrefix: namePrefix, log: log, fs: fs);
|
||||
return FlutterSkippingFileComparator(
|
||||
basedir,
|
||||
skiaClient,
|
||||
reason,
|
||||
namePrefix: namePrefix,
|
||||
log: log,
|
||||
fs: fs,
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -549,7 +572,12 @@ class FlutterLocalFileComparator extends FlutterGoldenFileComparator with LocalC
|
||||
);
|
||||
}
|
||||
|
||||
return FlutterLocalFileComparator(baseDirectory.uri, goldens, log: log, fs: fs);
|
||||
return FlutterLocalFileComparator(
|
||||
baseDirectory.uri,
|
||||
goldens,
|
||||
log: log,
|
||||
fs: fs,
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
|
||||
Reference in New Issue
Block a user