mirror of
https://github.com/flutter/flutter
synced 2024-10-12 19:23:02 +00:00
Anaalyzer fixes.
This commit is contained in:
parent
abb555fe94
commit
fdd554fb46
|
@ -91,7 +91,7 @@ class FlutterGoldenFileComparator implements GoldenFileComparator {
|
|||
}
|
||||
final bool authorized = await _skiaClient.auth(fs.directory(basedir));
|
||||
if (!authorized) {
|
||||
//TODO(katelovett): Clean up for final implementation on CI
|
||||
// TODO(Piinks): Clean up for final implementation on CI, https://github.com/flutter/flutter/pull/31630
|
||||
return true;
|
||||
//throw test_package.TestFailure('Could not authorize golctl.');
|
||||
}
|
||||
|
|
|
@ -13,35 +13,36 @@ import 'package:platform/platform.dart';
|
|||
import 'package:process/process.dart';
|
||||
|
||||
const String _kFlutterRoot = '/flutter';
|
||||
const String _kGoldenRoot = '$_kFlutterRoot/bin/cache/pkg/goldens';
|
||||
//const String _kGoldenRoot = '$_kFlutterRoot/bin/cache/pkg/goldens';
|
||||
//const String _kVersionFile = '$_kFlutterRoot/bin/internal/goldens.version';
|
||||
//const String _kGoldensVersion = '123456abcdef';
|
||||
//TODO(katelovett): Finish testing
|
||||
// TODO(Piinks): Finish testing, https://github.com/flutter/flutter/pull/31630
|
||||
void main() {
|
||||
MemoryFileSystem fs;
|
||||
FakePlatform platform;
|
||||
MockProcessManager process;
|
||||
Directory flutter;
|
||||
Directory golden;
|
||||
//Directory flutter;
|
||||
//Directory golden;
|
||||
|
||||
setUp(() async {
|
||||
fs = MemoryFileSystem();
|
||||
platform = FakePlatform(environment: <String, String>{
|
||||
'FLUTTER_ROOT': _kFlutterRoot,
|
||||
//TODO(katelovett): Add other env vars for testing
|
||||
// TODO(Piinks): Add other env vars for testing, https://github.com/flutter/flutter/pull/31630
|
||||
});
|
||||
process = MockProcessManager();
|
||||
flutter = await fs.directory(_kFlutterRoot).create(recursive: true);
|
||||
golden = await fs.directory(_kGoldenRoot).create(recursive: true);
|
||||
//flutter = await fs.directory(_kFlutterRoot).create(recursive: true);
|
||||
//golden = await fs.directory(_kGoldenRoot).create(recursive: true);
|
||||
//fs.file(_kVersionFile).createSync(recursive: true);
|
||||
//fs.file(_kVersionFile).writeAsStringSync(_kGoldensVersion);
|
||||
});
|
||||
|
||||
group('SkiaGoldClient', () {
|
||||
SkiaGoldClient skiaGold;
|
||||
//SkiaGoldClient skiaGold;
|
||||
|
||||
setUp(() {
|
||||
skiaGold = SkiaGoldClient(
|
||||
//skiaGold =
|
||||
SkiaGoldClient(
|
||||
fs: fs,
|
||||
platform: platform,
|
||||
process: process,
|
||||
|
@ -105,7 +106,7 @@ void main() {
|
|||
}
|
||||
});
|
||||
|
||||
// TODO(katelovett): This is currently disabled in flutter_goldens.dart
|
||||
// TODO(Piinks): This is currently disabled in flutter_goldens.dart, https://github.com/flutter/flutter/pull/31630
|
||||
// test('throws if goldctl has not been authorized', () async {
|
||||
// // See that preceding test does not leave auth behind [52]
|
||||
// try {
|
||||
|
@ -115,8 +116,7 @@ void main() {
|
|||
// expect(error.message, contains('Could not authorize goldctl.'));
|
||||
// }
|
||||
// });
|
||||
// TODO(katelovett): Add methods to Mock SkiaGoldClient to inform the comparator
|
||||
// TODO... and test for proper behavior. See matcher_test.dart for model
|
||||
// TODO(Piinks): Add methods to Mock SkiaGoldClient to inform the comparator and test for proper behavior. See matcher_test.dart for model, https://github.com/flutter/flutter/pull/31630
|
||||
// test('returns false if skia gold test fails', () async {
|
||||
// final File goldenFile = fs.file('/path/to/flutter/bin/cache/goldens/test/foo/bar/test.png')
|
||||
// ..createSync(recursive: true);
|
||||
|
|
|
@ -51,7 +51,7 @@ class SkiaGoldClient {
|
|||
|
||||
Directory _workDirectory;
|
||||
|
||||
//TODO(katelovett): Environment variables are temporary for local testing
|
||||
// TODO(Piinks): Environment variables are temporary for local testing, https://github.com/flutter/flutter/pull/31630
|
||||
/// The local [Directory] where the Flutter repository is hosted.
|
||||
///
|
||||
/// Uses the [fs] file system.
|
||||
|
@ -80,7 +80,7 @@ class SkiaGoldClient {
|
|||
Future<bool> auth(Directory workDirectory) async {
|
||||
_workDirectory = workDirectory;
|
||||
|
||||
//TODO(katelovett): Cleanup for final CI implementation
|
||||
// TODO(Piinks): Cleanup for final CI implementation, https://github.com/flutter/flutter/pull/31630
|
||||
if (_serviceAccount == null)
|
||||
return false; // Not in the proper environment for golden file testing.
|
||||
|
||||
|
@ -188,7 +188,7 @@ class SkiaGoldClient {
|
|||
}
|
||||
|
||||
Future<String> _getCommitHash() async {
|
||||
// TODO(katelovett): Remove after pre-commit tests can be ingested by Skia Gold
|
||||
// TODO(Piinks): Remove after pre-commit tests can be ingested by Skia Gold, https://github.com/flutter/flutter/pull/31630
|
||||
return 'e51947241b37790a9e4e33bfdef59aaa9b930851';
|
||||
// if (!flutterRoot.existsSync()) {
|
||||
// return null;
|
||||
|
@ -214,7 +214,7 @@ class SkiaGoldClient {
|
|||
}
|
||||
|
||||
String _getKeysJSON() {
|
||||
// TODO(katelovett): Parse out cleaner key information
|
||||
// TODO(Piinks): Parse out cleaner key information, https://github.com/flutter/flutter/pull/31630
|
||||
return convert.json.encode(
|
||||
<String, dynamic>{
|
||||
'Operating System' : io.Platform.operatingSystem,
|
||||
|
|
Loading…
Reference in a new issue