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
72696f77
Unverified
Commit
72696f77
authored
Oct 08, 2020
by
Kate Lovett
Committed by
GitHub
Oct 08, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove Cirrus support for Gold (#67468)
parent
4acc7902
Changes
9
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
83 additions
and
707 deletions
+83
-707
.cirrus.yml
.cirrus.yml
+0
-3
download_goldctl.ps1
dev/bots/download_goldctl.ps1
+0
-18
download_goldctl.sh
dev/bots/download_goldctl.sh
+0
-9
Dockerfile
dev/ci/docker_linux/Dockerfile
+0
-5
basic_test.dart
packages/flutter/test/widgets/basic_test.dart
+1
-1
flutter_goldens.dart
packages/flutter_goldens/lib/flutter_goldens.dart
+26
-157
flutter_goldens_test.dart
packages/flutter_goldens/test/flutter_goldens_test.dart
+41
-366
json_templates.dart
packages/flutter_goldens/test/json_templates.dart
+0
-31
skia_client.dart
packages/flutter_goldens_client/lib/skia_client.dart
+15
-117
No files found.
.cirrus.yml
View file @
72696f77
...
@@ -89,7 +89,6 @@ task:
...
@@ -89,7 +89,6 @@ task:
# We use 3 CPUs because that's the minimum required to get framework_tests-widgets-linux
# We use 3 CPUs because that's the minimum required to get framework_tests-widgets-linux
# running fast enough that it is not the long pole, as of October 2019.
# running fast enough that it is not the long pole, as of October 2019.
CPU
:
3
CPU
:
3
GOLD_SERVICE_ACCOUNT
:
ENCRYPTED[3afeea5ac7201151c3d0dc9648862f0462b5e4f55dc600ca8b692319622f7c3eda3d577b1b16cc2ef0311b7314c1c095]
script
:
script
:
-
dart --enable-asserts ./dev/bots/test.dart
-
dart --enable-asserts ./dev/bots/test.dart
...
@@ -100,7 +99,6 @@ task:
...
@@ -100,7 +99,6 @@ task:
# framework_tests-libraries-linux shard running fast enough that it is not the long pole, as
# framework_tests-libraries-linux shard running fast enough that it is not the long pole, as
# of October 2019.
# of October 2019.
CPU
:
3
CPU
:
3
GOLD_SERVICE_ACCOUNT
:
ENCRYPTED[3afeea5ac7201151c3d0dc9648862f0462b5e4f55dc600ca8b692319622f7c3eda3d577b1b16cc2ef0311b7314c1c095]
script
:
script
:
-
dart --enable-asserts ./dev/bots/test.dart
-
dart --enable-asserts ./dev/bots/test.dart
...
@@ -150,7 +148,6 @@ task:
...
@@ -150,7 +148,6 @@ task:
CPU
:
2
CPU
:
2
MEMORY
:
8G
MEMORY
:
8G
CHROME_NO_SANDBOX
:
true
CHROME_NO_SANDBOX
:
true
GOLD_SERVICE_ACCOUNT
:
ENCRYPTED[3afeea5ac7201151c3d0dc9648862f0462b5e4f55dc600ca8b692319622f7c3eda3d577b1b16cc2ef0311b7314c1c095]
script
:
script
:
-
dart --enable-asserts ./dev/bots/test.dart
-
dart --enable-asserts ./dev/bots/test.dart
...
...
dev/bots/download_goldctl.ps1
deleted
100644 → 0
View file @
4acc7902
# Copyright 2014 The Flutter Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
$url
=
"https://storage.googleapis.com/chrome-infra/depot_tools.zip"
$zipPath
=
"C:\Windows\Temp\depot_tools.zip"
$path
=
"C:\Windows\Temp\depot_tools"
$gclient
=
"C:\Windows\Temp\depot_tools\gclient.bat"
$cipd
=
"C:\Windows\Temp\depot_tools\cipd.bat"
$ensureFile
=
"C:\Windows\Temp\depot_tools\ensure.txt"
$text
=
"# Ensure File
`n`$
ServiceURL https://chrome-infra-packages.appspot.com
`n`n
# Skia Gold Client goldctl
`n
skia/tools/goldctl/
`$
{platform} git_revision:b57f561ad4ad624bd399b8b7b500aa1955276d41"
(
New-Object
System.Net.WebClient
)
.DownloadFile
(
$url
,
$zipPath
)
Expand-Archive
-LiteralPath
$zipPath
-DestinationPath
$path
cd
$path
cmd.exe /C
"
$gclient
"
$text
|
Out-File
-filePath
$ensureFile
-encoding ascii
cmd.exe /C
"
$cipd
ensure -ensure-file
$ensureFile
-root
$path
"
dev/bots/download_goldctl.sh
deleted
100755 → 0
View file @
4acc7902
#!/usr/bin/env bash
# Copyright 2014 The Flutter Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
git clone
--depth
1 https://chromium.googlesource.com/chromium/tools/depot_tools.git ./depot_tools
cd
depot_tools
echo
-e
'# Ensure File\n$ServiceURL https://chrome-infra-packages.appspot.com\n\n# Skia Gold Client goldctl\nskia/tools/goldctl/${platform} git_revision:b57f561ad4ad624bd399b8b7b500aa1955276d41'
>
ensure.txt
./cipd ensure
-ensure-file
./ensure.txt
-root
.
dev/ci/docker_linux/Dockerfile
View file @
72696f77
...
@@ -123,8 +123,3 @@ COPY ci/docker_linux/Gemfile.lock /Gemfile.lock
...
@@ -123,8 +123,3 @@ COPY ci/docker_linux/Gemfile.lock /Gemfile.lock
RUN
bundle config
set
system
'true'
&&
\
RUN
bundle config
set
system
'true'
&&
\
bundle
install
--system
bundle
install
--system
# Install goldctl, for Golden testing
COPY
bots/download_goldctl.sh /download_goldctl.sh
ENV
GOLDCTL '/depot_tools/goldctl'
RUN
/download_goldctl.sh
packages/flutter/test/widgets/basic_test.dart
View file @
72696f77
...
@@ -443,7 +443,7 @@ void main() {
...
@@ -443,7 +443,7 @@ void main() {
// golden file can be approved at any time.
// golden file can be approved at any time.
await
tester
.
pumpWidget
(
RepaintBoundary
(
await
tester
.
pumpWidget
(
RepaintBoundary
(
child:
Container
(
child:
Container
(
color:
const
Color
(
0x
FF42A5F5
),
color:
const
Color
(
0x
ABCDABCD
),
),
),
));
));
...
...
packages/flutter_goldens/lib/flutter_goldens.dart
View file @
72696f77
This diff is collapsed.
Click to expand it.
packages/flutter_goldens/test/flutter_goldens_test.dart
View file @
72696f77
This diff is collapsed.
Click to expand it.
packages/flutter_goldens/test/json_templates.dart
View file @
72696f77
...
@@ -16,37 +16,6 @@ String authTemplate({
...
@@ -16,37 +16,6 @@ String authTemplate({
'''
;
'''
;
}
}
/// Json response template for Skia Gold ignore request:
/// https://flutter-gold.skia.org/json/v1/ignores
String
ignoreResponseTemplate
(
{
String
pullRequestNumber
=
'0000'
,
String
testName
=
'flutter.golden_test.1'
,
String
otherTestName
=
'flutter.golden_test.1'
,
String
expires
=
'2019-09-06T21:28:18.815336Z'
,
String
otherExpires
=
'2019-09-06T21:28:18.815336Z'
,
})
{
return
'''
[
{
"id": "7579425228619212078",
"name": "contributor@getMail.com",
"updatedBy": "contributor@getMail.com",
"expires": "
$expires
",
"query": "ext=png&name=
$testName
",
"note": "https://github.com/flutter/flutter/pull/
$pullRequestNumber
"
},
{
"id": "7579425228619212078",
"name": "contributor@getMail.com",
"updatedBy": "contributor@getMail.com",
"expires": "
$otherExpires
",
"query": "ext=png&name=
$otherTestName
",
"note": "https://github.com/flutter/flutter/pull/99999"
}
]
'''
;
}
/// Json response template for Skia Gold image request:
/// Json response template for Skia Gold image request:
/// https://flutter-gold.skia.org/img/images/[imageHash].png
/// https://flutter-gold.skia.org/img/images/[imageHash].png
List
<
List
<
int
>>
imageResponseTemplate
()
{
List
<
List
<
int
>>
imageResponseTemplate
()
{
...
...
packages/flutter_goldens_client/lib/skia_client.dart
View file @
72696f77
...
@@ -17,16 +17,8 @@ import 'package:process/process.dart';
...
@@ -17,16 +17,8 @@ import 'package:process/process.dart';
const
String
_kFlutterRootKey
=
'FLUTTER_ROOT'
;
const
String
_kFlutterRootKey
=
'FLUTTER_ROOT'
;
const
String
_kGoldctlKey
=
'GOLDCTL'
;
const
String
_kGoldctlKey
=
'GOLDCTL'
;
const
String
_kServiceAccountKey
=
'GOLD_SERVICE_ACCOUNT'
;
const
String
_kTestBrowserKey
=
'FLUTTER_TEST_BROWSER'
;
const
String
_kTestBrowserKey
=
'FLUTTER_TEST_BROWSER'
;
/// Enum representing the supported CI environments used by flutter/flutter.
enum
ContinuousIntegrationEnvironment
{
luci
,
cirrus
,
none
,
}
/// A client for uploading image tests and making baseline requests to the
/// A client for uploading image tests and making baseline requests to the
/// Flutter Gold Dashboard.
/// Flutter Gold Dashboard.
class
SkiaGoldClient
{
class
SkiaGoldClient
{
...
@@ -35,7 +27,6 @@ class SkiaGoldClient {
...
@@ -35,7 +27,6 @@ class SkiaGoldClient {
this
.
fs
=
const
LocalFileSystem
(),
this
.
fs
=
const
LocalFileSystem
(),
this
.
process
=
const
LocalProcessManager
(),
this
.
process
=
const
LocalProcessManager
(),
this
.
platform
=
const
LocalPlatform
(),
this
.
platform
=
const
LocalPlatform
(),
required
this
.
ci
,
io
.
HttpClient
?
httpClient
,
io
.
HttpClient
?
httpClient
,
})
:
httpClient
=
httpClient
??
io
.
HttpClient
();
})
:
httpClient
=
httpClient
??
io
.
HttpClient
();
...
@@ -58,9 +49,6 @@ class SkiaGoldClient {
...
@@ -58,9 +49,6 @@ class SkiaGoldClient {
/// sub-processes.
/// sub-processes.
final
ProcessManager
process
;
final
ProcessManager
process
;
/// What testing environment we may be in, like Cirrus or Luci.
final
ContinuousIntegrationEnvironment
ci
;
/// A client for making Http requests to the Flutter Gold dashboard.
/// A client for making Http requests to the Flutter Gold dashboard.
final
io
.
HttpClient
httpClient
;
final
io
.
HttpClient
httpClient
;
...
@@ -82,12 +70,6 @@ class SkiaGoldClient {
...
@@ -82,12 +70,6 @@ class SkiaGoldClient {
/// Uses the [platform] environment in this implementation.
/// Uses the [platform] environment in this implementation.
String
get
_goldctl
=>
platform
.
environment
[
_kGoldctlKey
]!;
String
get
_goldctl
=>
platform
.
environment
[
_kGoldctlKey
]!;
/// The path to the local [Directory] where the service account key is
/// hosted.
///
/// Uses the [platform] environment in this implementation.
String
get
_serviceAccount
=>
platform
.
environment
[
_kServiceAccountKey
]!;
/// Prepares the local work space for golden file testing and calls the
/// Prepares the local work space for golden file testing and calls the
/// goldctl `auth` command.
/// goldctl `auth` command.
///
///
...
@@ -101,81 +83,12 @@ class SkiaGoldClient {
...
@@ -101,81 +83,12 @@ class SkiaGoldClient {
Future
<
void
>
auth
()
async
{
Future
<
void
>
auth
()
async
{
if
(
await
clientIsAuthorized
())
if
(
await
clientIsAuthorized
())
return
;
return
;
List
<
String
>
authArguments
;
String
failureContext
;
switch
(
ci
)
{
case
ContinuousIntegrationEnvironment
.
luci
:
authArguments
=
<
String
>[
'auth'
,
'--work-dir'
,
workDirectory
.
childDirectory
(
'temp'
)
.
path
,
'--luci'
,
];
failureContext
=
'Luci environments authenticate using the file provided '
'by LUCI_CONTEXT. There may be an error with this file or Gold '
'authentication.'
;
break
;
case
ContinuousIntegrationEnvironment
.
cirrus
:
if
(
_serviceAccount
.
isEmpty
)
{
final
StringBuffer
buf
=
StringBuffer
()
..
writeln
(
'The Gold service account is unavailable.'
)..
writeln
(
'Without a service account, Gold can not be authorized.'
)..
writeln
(
'Please check your user permissions and current comparator.'
);
throw
Exception
(
buf
.
toString
());
}
final
File
authorization
=
workDirectory
.
childFile
(
'serviceAccount.json'
);
await
authorization
.
writeAsString
(
_serviceAccount
);
authArguments
=
<
String
>[
'auth'
,
'--service-account'
,
authorization
.
path
,
'--work-dir'
,
workDirectory
.
childDirectory
(
'temp'
)
.
path
,
];
failureContext
=
'This could be caused by incorrect user permissions on '
'Cirrus, if the debug information below contains ENCRYPTED, the wrong '
'comparator was chosen for the test case.'
;
break
;
case
ContinuousIntegrationEnvironment
.
none
:
return
;
}
final
io
.
ProcessResult
result
=
await
io
.
Process
.
run
(
_goldctl
,
authArguments
,
);
if
(
result
.
exitCode
!=
0
)
{
final
StringBuffer
buf
=
StringBuffer
()
..
writeln
(
'Skia Gold authorization failed.'
)
..
writeln
(
failureContext
)
..
writeln
(
'Debug information for Gold:'
)
..
writeln
(
'stdout:
${result.stdout}
'
)
..
writeln
(
'stderr:
${result.stderr}
'
);
throw
Exception
(
buf
.
toString
());
}
}
/// Prepares the local work space for an unauthorized client to lookup golden
/// file expectations using [imgtestCheck].
///
/// It will only be called once for each instance of an
/// [_UnauthorizedFlutterPreSubmitComparator].
Future
<
void
>
emptyAuth
()
async
{
// We only use emptyAuth when the service account cannot be decrypted on
// Cirrus.
assert
(
ci
==
ContinuousIntegrationEnvironment
.
cirrus
);
final
List
<
String
>
authArguments
=
<
String
>[
final
List
<
String
>
authArguments
=
<
String
>[
'auth'
,
'auth'
,
'--work-dir'
,
workDirectory
'--work-dir'
,
workDirectory
.
childDirectory
(
'temp'
)
.
childDirectory
(
'temp'
)
.
path
,
.
path
,
'--luci'
,
];
];
final
io
.
ProcessResult
result
=
await
io
.
Process
.
run
(
final
io
.
ProcessResult
result
=
await
io
.
Process
.
run
(
...
@@ -185,8 +98,10 @@ class SkiaGoldClient {
...
@@ -185,8 +98,10 @@ class SkiaGoldClient {
if
(
result
.
exitCode
!=
0
)
{
if
(
result
.
exitCode
!=
0
)
{
final
StringBuffer
buf
=
StringBuffer
()
final
StringBuffer
buf
=
StringBuffer
()
..
writeln
(
'Skia Gold emptyAuth failed.'
)
..
writeln
(
'Skia Gold authorization failed.'
)
..
writeln
()
..
writeln
(
'Luci environments authenticate using the file provided '
'by LUCI_CONTEXT. There may be an error with this file or Gold '
'authentication.'
)
..
writeln
(
'Debug information for Gold:'
)
..
writeln
(
'Debug information for Gold:'
)
..
writeln
(
'stdout:
${result.stdout}
'
)
..
writeln
(
'stdout:
${result.stdout}
'
)
..
writeln
(
'stderr:
${result.stderr}
'
);
..
writeln
(
'stderr:
${result.stderr}
'
);
...
@@ -306,10 +221,9 @@ class SkiaGoldClient {
...
@@ -306,10 +221,9 @@ class SkiaGoldClient {
'--passfail'
,
'--passfail'
,
'--crs'
,
'github'
,
'--crs'
,
'github'
,
'--patchset_id'
,
commitHash
,
'--patchset_id'
,
commitHash
,
...
getCIArguments
(),
];
];
imgtestInitArguments
.
addAll
(
getCIArguments
());
if
(
imgtestInitArguments
.
contains
(
null
))
{
if
(
imgtestInitArguments
.
contains
(
null
))
{
final
StringBuffer
buf
=
StringBuffer
()
final
StringBuffer
buf
=
StringBuffer
()
..
writeln
(
'A null argument was provided for Skia Gold tryjob init.'
)
..
writeln
(
'A null argument was provided for Skia Gold tryjob init.'
)
...
@@ -558,10 +472,12 @@ class SkiaGoldClient {
...
@@ -558,10 +472,12 @@ class SkiaGoldClient {
String
_getKeysJSON
()
{
String
_getKeysJSON
()
{
final
Map
<
String
,
dynamic
>
keys
=
<
String
,
dynamic
>{
final
Map
<
String
,
dynamic
>
keys
=
<
String
,
dynamic
>{
'Platform'
:
platform
.
operatingSystem
,
'Platform'
:
platform
.
operatingSystem
,
'CI'
:
ci
.
toString
().
split
(
'.'
).
last
,
'CI'
:
'luci'
,
};
};
if
(
platform
.
environment
[
_kTestBrowserKey
]
!=
null
)
if
(
platform
.
environment
[
_kTestBrowserKey
]
!=
null
)
{
keys
[
'Browser'
]
=
platform
.
environment
[
_kTestBrowserKey
];
keys
[
'Browser'
]
=
platform
.
environment
[
_kTestBrowserKey
];
keys
[
'Platform'
]
=
keys
[
'Platform'
]
+
'-browser'
;
}
return
json
.
encode
(
keys
);
return
json
.
encode
(
keys
);
}
}
...
@@ -590,29 +506,13 @@ class SkiaGoldClient {
...
@@ -590,29 +506,13 @@ class SkiaGoldClient {
/// Returns a list of arguments for initializing a tryjob based on the testing
/// Returns a list of arguments for initializing a tryjob based on the testing
/// environment.
/// environment.
List
<
String
>
getCIArguments
()
{
List
<
String
>
getCIArguments
()
{
String
pullRequest
;
final
String
jobId
=
platform
.
environment
[
'LOGDOG_STREAM_PREFIX'
]!.
split
(
'/'
).
last
;
String
jobId
;
final
List
<
String
>
refs
=
platform
.
environment
[
'GOLD_TRYJOB'
]!.
split
(
'/'
);
String
cis
;
final
String
pullRequest
=
refs
[
refs
.
length
-
2
];
switch
(
ci
)
{
case
ContinuousIntegrationEnvironment
.
luci
:
jobId
=
platform
.
environment
[
'LOGDOG_STREAM_PREFIX'
]!.
split
(
'/'
).
last
;
final
List
<
String
>
refs
=
platform
.
environment
[
'GOLD_TRYJOB'
]!.
split
(
'/'
);
pullRequest
=
refs
[
refs
.
length
-
2
];
cis
=
'buildbucket'
;
break
;
case
ContinuousIntegrationEnvironment
.
cirrus
:
pullRequest
=
platform
.
environment
[
'CIRRUS_PR'
]!;
jobId
=
platform
.
environment
[
'CIRRUS_TASK_ID'
]!;
cis
=
'cirrus'
;
break
;
case
ContinuousIntegrationEnvironment
.
none
:
return
<
String
>[];
}
return
<
String
>[
return
<
String
>[
'--changelist'
,
pullRequest
,
'--changelist'
,
pullRequest
,
'--cis'
,
cis
,
'--cis'
,
'buildbucket'
,
'--jobid'
,
jobId
,
'--jobid'
,
jobId
,
];
];
}
}
...
@@ -627,14 +527,12 @@ class SkiaGoldClient {
...
@@ -627,14 +527,12 @@ class SkiaGoldClient {
/// Example TraceID for Flutter Gold:
/// Example TraceID for Flutter Gold:
/// ',CI=cirrus,Platform=linux,name=cupertino.activityIndicator.inprogress.1.0,source_type=flutter,'
/// ',CI=cirrus,Platform=linux,name=cupertino.activityIndicator.inprogress.1.0,source_type=flutter,'
String
getTraceID
(
String
testName
)
{
String
getTraceID
(
String
testName
)
{
// If we are not in a CI environment, fallback on luci.
return
'
${platform.environment[_kTestBrowserKey] == null ? ',' : ',Browser=${platform.environment[_kTestBrowserKey]}
,'
}
'
return
'
${platform.environment[_kTestBrowserKey] == null ? ',' : ',Browser=${platform.environment[_kTestBrowserKey]}
,'
}
'
'
CI
=
$
{
ci
==
ContinuousIntegrationEnvironment
.
none
?
'luci'
:
ci
.
toString
().
split
(
'.'
).
last
}
,
'
'
CI
=
luci
,
'
'
Platform
=
$
{
platform
.
operatingSystem
},
'
'
Platform
=
$
{
platform
.
operatingSystem
},
'
'
name
=
$testName
,
'
'
name
=
$testName
,
'
'
source_type
=
flutter
,
';
'
source_type
=
flutter
,
';
}
}
}
}
/// Used to make HttpRequests during testing.
/// Used to make HttpRequests during testing.
...
...
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