diff --git a/packages/flutter/test/cupertino/date_picker_test.dart b/packages/flutter/test/cupertino/date_picker_test.dart index 4533c56c1e..2032924ad1 100644 --- a/packages/flutter/test/cupertino/date_picker_test.dart +++ b/packages/flutter/test/cupertino/date_picker_test.dart @@ -852,26 +852,23 @@ void main() { ) ); -// await expectLater( -// find.byType(CupertinoDatePicker), -// matchesGoldenFile('date_picker_test.datetime.initial.png'), -// skip: !Platform.isLinux -// ); - await expectLater( find.byType(CupertinoDatePicker), - matchesSkiaGoldFile('date_picker_test.datetime.initial.png'), + matchesSkiaGoldFile('date_picker_test.datetime.initial.png') +// matchesGoldenFile('date_picker_test.datetime.initial.png'), +// skip: !Platform.isLinux ); // Slightly drag the hour component to make the current hour off-center. await tester.drag(find.text('4'), Offset(0, _kRowOffset.dy / 2)); await tester.pump(); -// await expectLater( -// find.byType(CupertinoDatePicker), + await expectLater( + find.byType(CupertinoDatePicker), + matchesSkiaGoldFile('date_picker_test.datetime.drag.png'), // matchesGoldenFile('date_picker_test.datetime.drag.png'), // skip: !Platform.isLinux -// ); + ); }); } diff --git a/packages/flutter_goldens/lib/flutter_goldens.dart b/packages/flutter_goldens/lib/flutter_goldens.dart index 7aa23e9496..67795de66b 100644 --- a/packages/flutter_goldens/lib/flutter_goldens.dart +++ b/packages/flutter_goldens/lib/flutter_goldens.dart @@ -30,11 +30,9 @@ Future main(FutureOr testMain()) async { /// Within the https://github.com/flutter/flutter repository, it's important /// not to check-in binaries in order to keep the size of the repository to a /// minimum. To satisfy this requirement, this comparator uses the -/// [SkiaGoldClient] to upload widgets for golden tests and process results. +/// [SkiaGoldClient] to upload widgets for framework-related golden tests and +/// process results. /// -/// This comparator will locally clone the `flutter/goldens` repository into -/// the `$FLUTTER_ROOT/bin/cache/pkg/goldens` folder, then perform the comparison against -/// the files therein. /// This comparator will instantiate the [SkiaGoldClient] and process the /// results of the test. class FlutterGoldenFileComparator implements GoldenFileComparator { @@ -71,9 +69,14 @@ class FlutterGoldenFileComparator implements GoldenFileComparator { // Calculate the appropriate basedir for the current test context. const FileSystem fs = LocalFileSystem(); final Directory testDirectory = fs.directory(defaultComparator.basedir); + //print('test: $testDirectory'); final Directory flutterRoot = fs.directory(Platform.environment[_kFlutterRootKey]); + //print('flutter: $flutterRoot'); final Directory goldenRoot = flutterRoot.childDirectory(fs.path.join('bin', 'cache', 'pkg', 'goldens')); + //print('golden: $goldenRoot'); final String testDirectoryRelativePath = fs.path.relative(testDirectory.path, from: flutterRoot.path); + //print('testDRP: $testDirectoryRelativePath'); + //print('FGFC instantiated with:${goldenRoot.childDirectory(testDirectoryRelativePath).uri}'); return FlutterGoldenFileComparator(goldenRoot.childDirectory(testDirectoryRelativePath).uri); } diff --git a/packages/flutter_goldens_client/lib/client.dart b/packages/flutter_goldens_client/lib/client.dart index cb36481db1..9bfaab7486 100644 --- a/packages/flutter_goldens_client/lib/client.dart +++ b/packages/flutter_goldens_client/lib/client.dart @@ -142,20 +142,22 @@ class SkiaGoldClient { ..writeln('stderr: ${imgtestResult.stderr}'); throw NonZeroExitCode(imgtestResult.exitCode, buf.toString()); } + print('PASS'); return true; } Future _getCommitHash() async { - if (!flutterRoot.existsSync()) { - return null; - } else { - final io.ProcessResult revParse = await process.run( - ['git', 'rev-parse', 'HEAD'], - workingDirectory: flutterRoot.path, - ); - return revParse.exitCode == 0 ? revParse.stdout.trim() : null; + // TODO: Remove after baseline is established and pre-commit works + return 'b27b3d744670bb9312824ec94353b93e7d0424ea'; +// if (!flutterRoot.existsSync()) { +// return null; +// } else { +// final io.ProcessResult revParse = await process.run( +// ['git', 'rev-parse', 'HEAD'], +// workingDirectory: flutterRoot.path, +// ); +// return revParse.exitCode == 0 ? revParse.stdout.trim() : null; } - } String _getKeysJSON() { return convert.json.encode( diff --git a/packages/flutter_tools/lib/src/commands/update_packages.dart b/packages/flutter_tools/lib/src/commands/update_packages.dart index a7f581b8f4..0010337052 100644 --- a/packages/flutter_tools/lib/src/commands/update_packages.dart +++ b/packages/flutter_tools/lib/src/commands/update_packages.dart @@ -135,6 +135,7 @@ class UpdatePackagesCommand extends FlutterCommand { // The dev/integration_tests/android_views integration test depends on an assets // package that is in the goldens repository. We need to make sure that the goldens // repository is cloned locally before we verify or update pubspecs. + // TODO(katelovett): Resolve dependency for android_views living in goldens repository // printStatus('Cloning goldens repository...'); // try { // final GoldensClient goldensClient = GoldensClient();