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
ea67a65b
Unverified
Commit
ea67a65b
authored
Mar 18, 2020
by
Kate Lovett
Committed by
GitHub
Mar 18, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Re-land Luci Support for Gold (#52760)
parent
2d9902d9
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
344 additions
and
150 deletions
+344
-150
action_sheet.dart
packages/flutter/lib/src/cupertino/action_sheet.dart
+2
-1
flutter_goldens.dart
packages/flutter_goldens/lib/flutter_goldens.dart
+107
-71
flutter_goldens_test.dart
packages/flutter_goldens/test/flutter_goldens_test.dart
+119
-30
skia_client.dart
packages/flutter_goldens_client/lib/skia_client.dart
+116
-48
No files found.
packages/flutter/lib/src/cupertino/action_sheet.dart
View file @
ea67a65b
...
@@ -85,7 +85,8 @@ const double _kDividerThickness = 1.0;
...
@@ -85,7 +85,8 @@ const double _kDividerThickness = 1.0;
/// sheet title and message text style.
/// sheet title and message text style.
///
///
/// To display action buttons that look like standard iOS action sheet buttons,
/// To display action buttons that look like standard iOS action sheet buttons,
/// provide [CupertinoActionSheetAction]s for the [actions] given to this action sheet.
/// provide [CupertinoActionSheetAction]s for the [actions] given to this action
/// sheet.
///
///
/// To include a iOS-style cancel button separate from the other buttons,
/// To include a iOS-style cancel button separate from the other buttons,
/// provide an [CupertinoActionSheetAction] for the [cancelButton] given to this
/// provide an [CupertinoActionSheetAction] for the [cancelButton] given to this
...
...
packages/flutter_goldens/lib/flutter_goldens.dart
View file @
ea67a65b
This diff is collapsed.
Click to expand it.
packages/flutter_goldens/test/flutter_goldens_test.dart
View file @
ea67a65b
...
@@ -108,6 +108,7 @@ void main() {
...
@@ -108,6 +108,7 @@ void main() {
process:
process
,
process:
process
,
platform:
platform
,
platform:
platform
,
httpClient:
mockHttpClient
,
httpClient:
mockHttpClient
,
ci:
ContinuousIntegrationEnvironment
.
cirrus
,
);
);
when
(
process
.
run
(
any
))
when
(
process
.
run
(
any
))
...
@@ -165,6 +166,76 @@ void main() {
...
@@ -165,6 +166,76 @@ void main() {
);
);
});
});
test
(
'correctly inits tryjob for luci'
,
()
async
{
platform
=
FakePlatform
(
environment:
<
String
,
String
>{
'FLUTTER_ROOT'
:
_kFlutterRoot
,
'GOLDCTL'
:
'goldctl'
,
'SWARMING_TASK_ID'
:
'4ae997b50dfd4d11'
,
'LOGDOG_STREAM_PREFIX'
:
'buildbucket/cr-buildbucket.appspot.com/8885996262141582672'
,
'GOLD_TRYJOB'
:
'refs/pull/49815/head'
,
},
operatingSystem:
'macos'
);
skiaClient
=
SkiaGoldClient
(
workDirectory
,
fs:
fs
,
process:
process
,
platform:
platform
,
httpClient:
mockHttpClient
,
ci:
ContinuousIntegrationEnvironment
.
luci
,
);
final
List
<
String
>
ciArguments
=
skiaClient
.
getCIArguments
();
expect
(
ciArguments
,
equals
(
<
String
>[
'--changelist'
,
'49815'
,
'--cis'
,
'buildbucket'
,
'--jobid'
,
'8885996262141582672'
,
],
),
);
});
test
(
'correctly inits tryjob for cirrus'
,
()
async
{
platform
=
FakePlatform
(
environment:
<
String
,
String
>{
'FLUTTER_ROOT'
:
_kFlutterRoot
,
'GOLDCTL'
:
'goldctl'
,
'CIRRUS_CI'
:
'true'
,
'CIRRUS_TASK_ID'
:
'8885996262141582672'
,
'CIRRUS_PR'
:
'49815'
,
},
operatingSystem:
'macos'
);
skiaClient
=
SkiaGoldClient
(
workDirectory
,
fs:
fs
,
process:
process
,
platform:
platform
,
httpClient:
mockHttpClient
,
ci:
ContinuousIntegrationEnvironment
.
cirrus
,
);
final
List
<
String
>
ciArguments
=
skiaClient
.
getCIArguments
();
expect
(
ciArguments
,
equals
(
<
String
>[
'--changelist'
,
'49815'
,
'--cis'
,
'cirrus'
,
'--jobid'
,
'8885996262141582672'
,
],
),
);
});
group
(
'Request Handling'
,
()
{
group
(
'Request Handling'
,
()
{
String
testName
;
String
testName
;
String
pullRequestNumber
;
String
pullRequestNumber
;
...
@@ -456,12 +527,12 @@ void main() {
...
@@ -456,12 +527,12 @@ void main() {
});
});
group
(
'FlutterGoldenFileComparator'
,
()
{
group
(
'FlutterGoldenFileComparator'
,
()
{
Flutter
SkiaGold
FileComparator
comparator
;
Flutter
PostSubmit
FileComparator
comparator
;
setUp
(()
{
setUp
(()
{
final
Directory
basedir
=
fs
.
directory
(
'flutter/test/library/'
)
final
Directory
basedir
=
fs
.
directory
(
'flutter/test/library/'
)
..
createSync
(
recursive:
true
);
..
createSync
(
recursive:
true
);
comparator
=
Flutter
SkiaGold
FileComparator
(
comparator
=
Flutter
PostSubmit
FileComparator
(
basedir
.
uri
,
basedir
.
uri
,
MockSkiaGoldClient
(),
MockSkiaGoldClient
(),
fs:
fs
,
fs:
fs
,
...
@@ -497,7 +568,7 @@ void main() {
...
@@ -497,7 +568,7 @@ void main() {
setUp
(()
{
setUp
(()
{
final
Directory
basedir
=
fs
.
directory
(
'flutter/test/library/'
)
final
Directory
basedir
=
fs
.
directory
(
'flutter/test/library/'
)
..
createSync
(
recursive:
true
);
..
createSync
(
recursive:
true
);
comparator
=
Flutter
SkiaGold
FileComparator
(
comparator
=
Flutter
PostSubmit
FileComparator
(
basedir
.
uri
,
basedir
.
uri
,
mockSkiaClient
,
mockSkiaClient
,
fs:
fs
,
fs:
fs
,
...
@@ -506,7 +577,22 @@ void main() {
...
@@ -506,7 +577,22 @@ void main() {
});
});
group
(
'correctly determines testing environment'
,
()
{
group
(
'correctly determines testing environment'
,
()
{
test
(
'returns true'
,
()
{
test
(
'returns true for Luci'
,
()
{
platform
=
FakePlatform
(
environment:
<
String
,
String
>{
'FLUTTER_ROOT'
:
_kFlutterRoot
,
'SWARMING_TASK_ID'
:
'12345678990'
,
'GOLDCTL'
:
'goldctl'
,
},
operatingSystem:
'macos'
);
expect
(
FlutterPostSubmitFileComparator
.
isAvailableForEnvironment
(
platform
),
isTrue
,
);
});
test
(
'returns true for Cirrus'
,
()
{
platform
=
FakePlatform
(
platform
=
FakePlatform
(
environment:
<
String
,
String
>{
environment:
<
String
,
String
>{
'FLUTTER_ROOT'
:
_kFlutterRoot
,
'FLUTTER_ROOT'
:
_kFlutterRoot
,
...
@@ -518,7 +604,7 @@ void main() {
...
@@ -518,7 +604,7 @@ void main() {
operatingSystem:
'macos'
operatingSystem:
'macos'
);
);
expect
(
expect
(
Flutter
SkiaGold
FileComparator
.
isAvailableForEnvironment
(
platform
),
Flutter
PostSubmit
FileComparator
.
isAvailableForEnvironment
(
platform
),
isTrue
,
isTrue
,
);
);
});
});
...
@@ -535,7 +621,7 @@ void main() {
...
@@ -535,7 +621,7 @@ void main() {
operatingSystem:
'macos'
operatingSystem:
'macos'
);
);
expect
(
expect
(
Flutter
SkiaGold
FileComparator
.
isAvailableForEnvironment
(
platform
),
Flutter
PostSubmit
FileComparator
.
isAvailableForEnvironment
(
platform
),
isFalse
,
isFalse
,
);
);
});
});
...
@@ -551,7 +637,7 @@ void main() {
...
@@ -551,7 +637,7 @@ void main() {
operatingSystem:
'macos'
operatingSystem:
'macos'
);
);
expect
(
expect
(
Flutter
SkiaGold
FileComparator
.
isAvailableForEnvironment
(
platform
),
Flutter
PostSubmit
FileComparator
.
isAvailableForEnvironment
(
platform
),
isFalse
,
isFalse
,
);
);
});
});
...
@@ -566,7 +652,7 @@ void main() {
...
@@ -566,7 +652,7 @@ void main() {
operatingSystem:
'macos'
operatingSystem:
'macos'
);
);
expect
(
expect
(
Flutter
SkiaGold
FileComparator
.
isAvailableForEnvironment
(
platform
),
Flutter
PostSubmit
FileComparator
.
isAvailableForEnvironment
(
platform
),
isFalse
,
isFalse
,
);
);
});
});
...
@@ -583,7 +669,7 @@ void main() {
...
@@ -583,7 +669,7 @@ void main() {
operatingSystem:
'macos'
operatingSystem:
'macos'
);
);
expect
(
expect
(
Flutter
SkiaGold
FileComparator
.
isAvailableForEnvironment
(
platform
),
Flutter
PostSubmit
FileComparator
.
isAvailableForEnvironment
(
platform
),
isFalse
,
isFalse
,
);
);
});
});
...
@@ -595,7 +681,7 @@ void main() {
...
@@ -595,7 +681,7 @@ void main() {
final
MockSkiaGoldClient
mockSkiaClient
=
MockSkiaGoldClient
();
final
MockSkiaGoldClient
mockSkiaClient
=
MockSkiaGoldClient
();
group
(
'correctly determines testing environment'
,
()
{
group
(
'correctly determines testing environment'
,
()
{
test
(
'returns true'
,
()
{
test
(
'returns true
for Cirrus
'
,
()
{
platform
=
FakePlatform
(
platform
=
FakePlatform
(
environment:
<
String
,
String
>{
environment:
<
String
,
String
>{
'FLUTTER_ROOT'
:
_kFlutterRoot
,
'FLUTTER_ROOT'
:
_kFlutterRoot
,
...
@@ -611,6 +697,22 @@ void main() {
...
@@ -611,6 +697,22 @@ void main() {
);
);
});
});
test
(
'returns true for Luci'
,
()
{
platform
=
FakePlatform
(
environment:
<
String
,
String
>{
'FLUTTER_ROOT'
:
_kFlutterRoot
,
'SWARMING_TASK_ID'
:
'12345678990'
,
'GOLDCTL'
:
'goldctl'
,
'GOLD_TRYJOB'
:
'git/ref/12345/head'
},
operatingSystem:
'macos'
);
expect
(
FlutterPreSubmitFileComparator
.
isAvailableForEnvironment
(
platform
),
isTrue
,
);
});
test
(
'returns false - no PR'
,
()
{
test
(
'returns false - no PR'
,
()
{
platform
=
FakePlatform
(
platform
=
FakePlatform
(
environment:
<
String
,
String
>{
environment:
<
String
,
String
>{
...
@@ -642,7 +744,7 @@ void main() {
...
@@ -642,7 +744,7 @@ void main() {
);
);
});
});
test
(
'returns false - not on Cirrus'
,
()
{
test
(
'returns false - not on Cirrus
or Luci
'
,
()
{
platform
=
FakePlatform
(
platform
=
FakePlatform
(
environment:
<
String
,
String
>{
environment:
<
String
,
String
>{
'FLUTTER_ROOT'
:
_kFlutterRoot
,
'FLUTTER_ROOT'
:
_kFlutterRoot
,
...
@@ -765,21 +867,7 @@ void main() {
...
@@ -765,21 +867,7 @@ void main() {
group
(
'Skipping'
,
()
{
group
(
'Skipping'
,
()
{
group
(
'correctly determines testing environment'
,
()
{
group
(
'correctly determines testing environment'
,
()
{
test
(
'returns true on LUCI'
,
()
{
test
(
'returns true on Cirrus shards that don
\'
t run golden tests'
,
()
{
platform
=
FakePlatform
(
environment:
<
String
,
String
>{
'FLUTTER_ROOT'
:
_kFlutterRoot
,
'SWARMING_TASK_ID'
:
'1234567890'
,
},
operatingSystem:
'macos'
);
expect
(
FlutterSkippingGoldenFileComparator
.
isAvailableForEnvironment
(
platform
),
isTrue
,
);
});
test
(
'returns true on Cirrus'
,
()
{
platform
=
FakePlatform
(
platform
=
FakePlatform
(
environment:
<
String
,
String
>{
environment:
<
String
,
String
>{
'FLUTTER_ROOT'
:
_kFlutterRoot
,
'FLUTTER_ROOT'
:
_kFlutterRoot
,
...
@@ -788,10 +876,11 @@ void main() {
...
@@ -788,10 +876,11 @@ void main() {
operatingSystem:
'macos'
operatingSystem:
'macos'
);
);
expect
(
expect
(
FlutterSkipping
Golden
FileComparator
.
isAvailableForEnvironment
(
platform
),
FlutterSkippingFileComparator
.
isAvailableForEnvironment
(
platform
),
isTrue
,
isTrue
,
);
);
});
});
test
(
'returns false - no CI'
,
()
{
test
(
'returns false - no CI'
,
()
{
platform
=
FakePlatform
(
platform
=
FakePlatform
(
environment:
<
String
,
String
>{
environment:
<
String
,
String
>{
...
@@ -800,7 +889,7 @@ void main() {
...
@@ -800,7 +889,7 @@ void main() {
operatingSystem:
'macos'
operatingSystem:
'macos'
);
);
expect
(
expect
(
FlutterSkipping
Golden
FileComparator
.
isAvailableForEnvironment
(
FlutterSkippingFileComparator
.
isAvailableForEnvironment
(
platform
),
platform
),
isFalse
,
isFalse
,
);
);
...
@@ -891,7 +980,7 @@ void main() {
...
@@ -891,7 +980,7 @@ void main() {
goldens:
mockSkiaClient
,
goldens:
mockSkiaClient
,
baseDirectory:
mockDirectory
,
baseDirectory:
mockDirectory
,
);
);
expect
(
comparator
.
runtimeType
,
FlutterSkipping
Golden
FileComparator
);
expect
(
comparator
.
runtimeType
,
FlutterSkippingFileComparator
);
when
(
mockSkiaClient
.
getExpectations
())
when
(
mockSkiaClient
.
getExpectations
())
.
thenAnswer
((
_
)
=>
throw
const
SocketException
(
"Can't reach Gold"
));
.
thenAnswer
((
_
)
=>
throw
const
SocketException
(
"Can't reach Gold"
));
...
@@ -900,7 +989,7 @@ void main() {
...
@@ -900,7 +989,7 @@ void main() {
goldens:
mockSkiaClient
,
goldens:
mockSkiaClient
,
baseDirectory:
mockDirectory
,
baseDirectory:
mockDirectory
,
);
);
expect
(
comparator
.
runtimeType
,
FlutterSkipping
Golden
FileComparator
);
expect
(
comparator
.
runtimeType
,
FlutterSkippingFileComparator
);
});
});
});
});
});
});
...
...
packages/flutter_goldens_client/lib/skia_client.dart
View file @
ea67a65b
This diff is collapsed.
Click to expand it.
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