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
14cceefe
Unverified
Commit
14cceefe
authored
Apr 13, 2020
by
Yegor
Committed by
GitHub
Apr 13, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make Web shard count configurable via WEB_SHARD_COUNT (#54678)
parent
ee43de04
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
7 deletions
+13
-7
.cirrus.yml
.cirrus.yml
+1
-0
test.dart
dev/bots/test.dart
+12
-7
No files found.
.cirrus.yml
View file @
14cceefe
...
@@ -5,6 +5,7 @@ web_shard_template: &WEB_SHARD_TEMPLATE
...
@@ -5,6 +5,7 @@ web_shard_template: &WEB_SHARD_TEMPLATE
only_if
:
"
changesInclude('.cirrus.yml',
'dev/**',
'packages/flutter/**',
'packages/flutter_test/**',
'packages/flutter_tools/lib/src/test/**',
'packages/flutter_web_plugins/**',
'bin/internal/**')
||
$CIRRUS_PR
==
''"
only_if
:
"
changesInclude('.cirrus.yml',
'dev/**',
'packages/flutter/**',
'packages/flutter_test/**',
'packages/flutter_tools/lib/src/test/**',
'packages/flutter_web_plugins/**',
'bin/internal/**')
||
$CIRRUS_PR
==
''"
environment
:
environment
:
# As of March 2020, the Web shards needed 16G of RAM and 4 CPUs to run all framework tests with goldens without flaking.
# As of March 2020, the Web shards needed 16G of RAM and 4 CPUs to run all framework tests with goldens without flaking.
WEB_SHARD_COUNT
:
8
CPU
:
4
CPU
:
4
MEMORY
:
16G
MEMORY
:
16G
CHROME_NO_SANDBOX
:
true
CHROME_NO_SANDBOX
:
true
...
...
dev/bots/test.dart
View file @
14cceefe
...
@@ -47,11 +47,16 @@ const int kDeviceLabShardCount = 4;
...
@@ -47,11 +47,16 @@ const int kDeviceLabShardCount = 4;
/// The number of Cirrus jobs that run Web tests in parallel.
/// The number of Cirrus jobs that run Web tests in parallel.
///
///
/// The default is 8 shards. Typically .cirrus.yml would define the
/// WEB_SHARD_COUNT environment variable rather than relying on the default.
///
/// WARNING: if you change this number, also change .cirrus.yml
/// WARNING: if you change this number, also change .cirrus.yml
/// and make sure it runs _all_ shards.
/// and make sure it runs _all_ shards.
///
///
/// The last shard also runs the Web plugin tests.
/// The last shard also runs the Web plugin tests.
const
int
kWebShardCount
=
8
;
int
get
webShardCount
=>
Platform
.
environment
.
containsKey
(
'WEB_SHARD_COUNT'
)
?
int
.
parse
(
Platform
.
environment
[
'WEB_SHARD_COUNT'
])
:
8
;
/// Tests that we don't run on Web for various reasons.
/// Tests that we don't run on Web for various reasons.
//
//
...
@@ -539,12 +544,12 @@ Future<void> _runWebUnitTests() async {
...
@@ -539,12 +544,12 @@ Future<void> _runWebUnitTests() async {
// We use a constant seed for repeatability.
// We use a constant seed for repeatability.
..
shuffle
(
math
.
Random
(
0
));
..
shuffle
(
math
.
Random
(
0
));
assert
(
kW
ebShardCount
>=
1
);
assert
(
w
ebShardCount
>=
1
);
final
int
testsPerShard
=
(
allTests
.
length
/
kW
ebShardCount
).
ceil
();
final
int
testsPerShard
=
(
allTests
.
length
/
w
ebShardCount
).
ceil
();
assert
(
testsPerShard
*
kW
ebShardCount
>=
allTests
.
length
);
assert
(
testsPerShard
*
w
ebShardCount
>=
allTests
.
length
);
// This for loop computes all but the last shard.
// This for loop computes all but the last shard.
for
(
int
index
=
0
;
index
<
kW
ebShardCount
-
1
;
index
+=
1
)
{
for
(
int
index
=
0
;
index
<
w
ebShardCount
-
1
;
index
+=
1
)
{
subshards
[
'
$index
'
]
=
()
=>
_runFlutterWebTest
(
subshards
[
'
$index
'
]
=
()
=>
_runFlutterWebTest
(
flutterPackageDirectory
.
path
,
flutterPackageDirectory
.
path
,
allTests
.
sublist
(
allTests
.
sublist
(
...
@@ -558,11 +563,11 @@ Future<void> _runWebUnitTests() async {
...
@@ -558,11 +563,11 @@ Future<void> _runWebUnitTests() async {
//
//
// We make sure the last shard ends in _last so it's easier to catch mismatches
// We make sure the last shard ends in _last so it's easier to catch mismatches
// between `.cirrus.yml` and `test.dart`.
// between `.cirrus.yml` and `test.dart`.
subshards
[
'
${
kW
ebShardCount - 1}
_last'
]
=
()
async
{
subshards
[
'
${
w
ebShardCount - 1}
_last'
]
=
()
async
{
await
_runFlutterWebTest
(
await
_runFlutterWebTest
(
flutterPackageDirectory
.
path
,
flutterPackageDirectory
.
path
,
allTests
.
sublist
(
allTests
.
sublist
(
(
kW
ebShardCount
-
1
)
*
testsPerShard
,
(
w
ebShardCount
-
1
)
*
testsPerShard
,
allTests
.
length
,
allTests
.
length
,
),
),
);
);
...
...
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