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
4b65c058
Unverified
Commit
4b65c058
authored
May 07, 2021
by
Kate Lovett
Committed by
GitHub
May 07, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Reduce potential collisions from Gold RNG (#81792)
parent
3101374f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
11 deletions
+5
-11
flutter_goldens.dart
packages/flutter_goldens/lib/flutter_goldens.dart
+5
-10
flutter_goldens_test.dart
packages/flutter_goldens/test/flutter_goldens_test.dart
+0
-1
No files found.
packages/flutter_goldens/lib/flutter_goldens.dart
View file @
4b65c058
...
...
@@ -4,7 +4,6 @@
import
'dart:async'
show
FutureOr
;
import
'dart:io'
as
io
show
OSError
,
SocketException
;
import
'dart:math'
as
math
show
Random
;
import
'dart:typed_data'
show
Uint8List
;
import
'package:file/file.dart'
;
...
...
@@ -131,17 +130,14 @@ abstract class FlutterGoldenFileComparator extends GoldenFileComparator {
static
Directory
getBaseDirectory
(
LocalFileComparator
defaultComparator
,
Platform
platform
,
{
String
suffix
=
''
,
bool
local
=
false
,
String
?
suffix
,
})
{
const
FileSystem
fs
=
LocalFileSystem
();
final
Directory
flutterRoot
=
fs
.
directory
(
platform
.
environment
[
_kFlutterRootKey
]);
Directory
comparisonRoot
;
if
(!
local
)
{
comparisonRoot
=
fs
.
systemTempDirectory
.
childDirectory
(
'skia_goldens_
$suffix
'
);
if
(
suffix
!=
null
)
{
comparisonRoot
=
fs
.
systemTempDirectory
.
createTempSync
(
suffix
);
}
else
{
comparisonRoot
=
flutterRoot
.
childDirectory
(
fs
.
path
.
join
(
...
...
@@ -225,7 +221,7 @@ class FlutterPostSubmitFileComparator extends FlutterGoldenFileComparator {
final
Directory
baseDirectory
=
FlutterGoldenFileComparator
.
getBaseDirectory
(
defaultComparator
,
platform
,
suffix:
'
${math.Random().nextInt(10000)}
'
,
suffix:
'
flutter_goldens_postsubmit.
'
,
);
baseDirectory
.
createSync
(
recursive:
true
);
...
...
@@ -304,7 +300,7 @@ class FlutterPreSubmitFileComparator extends FlutterGoldenFileComparator {
final
Directory
baseDirectory
=
testBasedir
??
FlutterGoldenFileComparator
.
getBaseDirectory
(
defaultComparator
,
platform
,
suffix:
'
${math.Random().nextInt(10000)}
'
,
suffix:
'
flutter_goldens_presubmit.
'
,
);
if
(!
baseDirectory
.
existsSync
())
...
...
@@ -469,7 +465,6 @@ class FlutterLocalFileComparator extends FlutterGoldenFileComparator with LocalC
baseDirectory
??=
FlutterGoldenFileComparator
.
getBaseDirectory
(
defaultComparator
,
platform
,
local:
true
,
);
if
(!
baseDirectory
.
existsSync
())
{
...
...
packages/flutter_goldens/test/flutter_goldens_test.dart
View file @
4b65c058
...
...
@@ -330,7 +330,6 @@ void main() {
final
Directory
basedir
=
FlutterGoldenFileComparator
.
getBaseDirectory
(
defaultComparator
,
platform
,
local:
true
,
);
expect
(
basedir
.
uri
,
...
...
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