Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
1fcd1b02
Commit
1fcd1b02
authored
Apr 24, 2019
by
Kate Lovett
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Changes for uploading baseline images.
parent
95d74481
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
26 additions
and
23 deletions
+26
-23
date_picker_test.dart
packages/flutter/test/cupertino/date_picker_test.dart
+7
-10
flutter_goldens.dart
packages/flutter_goldens/lib/flutter_goldens.dart
+7
-4
client.dart
packages/flutter_goldens_client/lib/client.dart
+11
-9
update_packages.dart
packages/flutter_tools/lib/src/commands/update_packages.dart
+1
-0
No files found.
packages/flutter/test/cupertino/date_picker_test.dart
View file @
1fcd1b02
...
...
@@ -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
//
);
);
});
}
...
...
packages/flutter_goldens/lib/flutter_goldens.dart
View file @
1fcd1b02
...
...
@@ -30,11 +30,9 @@ Future<void> main(FutureOr<void> 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
);
}
...
...
packages/flutter_goldens_client/lib/client.dart
View file @
1fcd1b02
...
...
@@ -142,20 +142,22 @@ class SkiaGoldClient {
..
writeln
(
'stderr:
${imgtestResult.stderr}
'
);
throw
NonZeroExitCode
(
imgtestResult
.
exitCode
,
buf
.
toString
());
}
print
(
'PASS'
);
return
true
;
}
Future
<
String
>
_getCommitHash
()
async
{
if
(!
flutterRoot
.
existsSync
())
{
return
null
;
}
else
{
final
io
.
ProcessResult
revParse
=
await
process
.
run
(
<
String
>[
'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(
// <String>['git', 'rev-parse', 'HEAD'],
// workingDirectory: flutterRoot.path,
// );
// return revParse.exitCode == 0 ? revParse.stdout.trim() : null;
}
}
String
_getKeysJSON
()
{
return
convert
.
json
.
encode
(
...
...
packages/flutter_tools/lib/src/commands/update_packages.dart
View file @
1fcd1b02
...
...
@@ -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();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment