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
953a9471
Unverified
Commit
953a9471
authored
Mar 30, 2019
by
Jonah Williams
Committed by
GitHub
Mar 30, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add coverage benchmark (#30222)
parent
22584305
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
2 deletions
+14
-2
flutter_test_performance.dart
dev/devicelab/bin/tasks/flutter_test_performance.dart
+14
-2
No files found.
dev/devicelab/bin/tasks/flutter_test_performance.dart
View file @
953a9471
...
...
@@ -36,11 +36,18 @@ enum TestStep {
testPassed
,
}
Future
<
int
>
runTest
()
async
{
Future
<
int
>
runTest
(
{
bool
coverage
=
false
}
)
async
{
final
Stopwatch
clock
=
Stopwatch
()..
start
();
final
List
<
String
>
arguments
=
<
String
>[
'test'
,
];
if
(
coverage
)
{
arguments
.
add
(
'--coverage'
);
}
arguments
.
add
(
path
.
join
(
'flutter_test'
,
'trivial_widget_test.dart'
));
final
Process
analysis
=
await
startProcess
(
path
.
join
(
flutterDirectory
.
path
,
'bin'
,
'flutter'
),
<
String
>[
'test'
,
path
.
join
(
'flutter_test'
,
'trivial_widget_test.dart'
)]
,
arguments
,
workingDirectory:
path
.
join
(
flutterDirectory
.
path
,
'dev'
,
'automated_tests'
),
);
int
badLines
=
0
;
...
...
@@ -50,6 +57,8 @@ Future<int> runTest() async {
if
(
step
==
TestStep
.
starting
&&
entry
==
'Building flutter tool...'
)
{
// ignore this line
step
=
TestStep
.
buildingFlutterTool
;
}
else
if
(
step
==
TestStep
.
testPassed
&&
entry
.
contains
(
'Collecting coverage information...'
))
{
// ignore this line
}
else
if
(
step
.
index
<
TestStep
.
runningPubGet
.
index
&&
entry
==
'Running "flutter packages get" in automated_tests...'
)
{
// ignore this line
step
=
TestStep
.
runningPubGet
;
...
...
@@ -113,10 +122,13 @@ void main() {
.
replaceAll
(
'_xyzzy'
,
'owner'
)
);
final
int
interfaceChange
=
await
runTest
();
// run test again with interface changed
// run test with coverage enabled.
final
int
withCoverage
=
await
runTest
(
coverage:
true
);
final
Map
<
String
,
dynamic
>
data
=
<
String
,
dynamic
>{
'without_change_elapsed_time_ms'
:
withoutChange
,
'implementation_change_elapsed_time_ms'
:
implementationChange
,
'interface_change_elapsed_time_ms'
:
interfaceChange
,
'with_coverage_time_ms'
:
withCoverage
,
};
return
TaskResult
.
success
(
data
,
benchmarkScoreKeys:
data
.
keys
.
toList
());
}
finally
{
...
...
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