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
190698d0
Unverified
Commit
190698d0
authored
Aug 23, 2019
by
Yegor
Committed by
GitHub
Aug 23, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
run web tests in batches; enable foundation tests (#37268)
* shard tests * make foundation tests pass
parent
d8833376
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
49 additions
and
23 deletions
+49
-23
test.dart
dev/bots/test.dart
+44
-19
assertions.dart
packages/flutter/lib/src/foundation/assertions.dart
+5
-4
No files found.
dev/bots/test.dart
View file @
190698d0
...
...
@@ -461,25 +461,19 @@ Future<void> _runTests() async {
}
Future
<
void
>
_runWebTests
()
async
{
//
Run a small subset of web tests to smoke-test the Web test infrastructure.
//
TODO(yjbanov): re-enable when web test cirrus flakiness is resolved
await
_runFlutterWebTest
(
path
.
join
(
flutterRoot
,
'packages'
,
'flutter'
),
tests:
<
String
>[
'test/foundation/assertions_test.dart'
,
'test/foundation/'
,
// TODO(yjbanov): re-enable when flakiness is resolved
// 'test/physics/',
// 'test/rendering/',
// 'test/services/',
// 'test/painting/',
// 'test/scheduler/',
// 'test/semantics/',
// 'test/widgets/',
// 'test/material/',
]);
// TODO(yjbanov): re-enable when web test cirrus flakiness is resolved
// await _runFlutterWebTest(path.join(flutterRoot, 'packages', 'flutter'), tests: <String>[
// 'test/foundation/',
// 'test/physics/',
// 'test/rendering/',
// 'test/services/',
// 'test/painting/',
// 'test/scheduler/',
// 'test/semantics/',
// TODO(yjbanov): re-enable when instabiliy around pumpAndSettle is
// // resolved.
// // 'test/widgets/',
// // 'test/material/',
// ]);
}
Future
<
void
>
_runCoverage
()
async
{
...
...
@@ -764,13 +758,44 @@ class EvalResult {
Future
<
void
>
_runFlutterWebTest
(
String
workingDirectory
,
{
List
<
String
>
tests
,
})
async
{
final
List
<
String
>
allTests
=
<
String
>[];
for
(
String
testDirPath
in
tests
)
{
final
Directory
testDir
=
Directory
(
path
.
join
(
workingDirectory
,
testDirPath
));
allTests
.
addAll
(
testDir
.
listSync
(
recursive:
true
)
.
whereType
<
File
>()
.
where
((
File
file
)
=>
file
.
path
.
endsWith
(
'_test.dart'
))
.
map
((
File
file
)
=>
path
.
relative
(
file
.
path
,
from:
workingDirectory
))
);
}
print
(
allTests
.
join
(
'
\n
'
));
print
(
'
${allTests.length}
tests total'
);
// Maximum number of tests to run in a single `flutter test`. We found that
// large batches can get flaky, possibly because we reuse a single instance
// of the browser, and after many tests the browser's state gets corrupted.
const
int
kBatchSize
=
20
;
List
<
String
>
batch
=
<
String
>[];
for
(
int
i
=
0
;
i
<
allTests
.
length
;
i
+=
1
)
{
final
String
testFilePath
=
allTests
[
i
];
batch
.
add
(
testFilePath
);
if
(
batch
.
length
==
kBatchSize
||
i
==
allTests
.
length
-
1
)
{
await
_runFlutterWebTestBatch
(
workingDirectory
,
batch:
batch
);
batch
=
<
String
>[];
}
}
}
Future
<
void
>
_runFlutterWebTestBatch
(
String
workingDirectory
,
{
List
<
String
>
batch
,
})
async
{
final
List
<
String
>
args
=
<
String
>[
'test'
,
'-v'
,
'--platform=chrome'
,
...?
flutterTestArgs
,
...
tests
,
...
batch
,
];
// TODO(jonahwilliams): fix relative path issues to make this unecessary.
...
...
@@ -781,7 +806,7 @@ Future<void> _runFlutterWebTest(String workingDirectory, {
flutter
,
args
,
workingDirectory:
workingDirectory
,
expectFlaky:
tru
e
,
expectFlaky:
fals
e
,
environment:
<
String
,
String
>{
'FLUTTER_WEB'
:
'true'
,
'FLUTTER_LOW_RESOURCE_MODE'
:
'true'
,
...
...
packages/flutter/lib/src/foundation/assertions.dart
View file @
190698d0
...
...
@@ -753,13 +753,14 @@ void debugPrintStack({StackTrace stackTrace, String label, int maxFrames}) {
debugPrint
(
label
);
stackTrace
??=
StackTrace
.
current
;
Iterable
<
String
>
lines
=
stackTrace
.
toString
().
trimRight
().
split
(
'
\n
'
);
if
(
kIsWeb
&&
lines
.
isNotEmpty
&&
lines
.
first
.
contains
(
'StackTrace.current'
))
{
if
(
kIsWeb
&&
lines
.
isNotEmpty
)
{
// Remove extra call to StackTrace.current for web platform.
// TODO(ferhat): remove when https://github.com/flutter/flutter/issues/37635
// is addressed.
lines
=
lines
.
skip
(
1
);
lines
=
lines
.
skipWhile
((
String
line
)
{
return
line
.
contains
(
'StackTrace.current'
)
||
line
.
contains
(
'dart:sdk_internal'
);
});
}
if
(
maxFrames
!=
null
)
lines
=
lines
.
take
(
maxFrames
);
...
...
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