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
abebd8b7
Unverified
Commit
abebd8b7
authored
May 12, 2022
by
keyonghan
Committed by
GitHub
May 12, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Separate build and test for `flutter_gallery__transition_perf` task (#103550)
parent
1602ea29
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
143 additions
and
2 deletions
+143
-2
flutter_gallery__transition_perf.dart
...devicelab/bin/tasks/flutter_gallery__transition_perf.dart
+2
-2
gallery.dart
dev/devicelab/lib/tasks/gallery.dart
+141
-0
No files found.
dev/devicelab/bin/tasks/flutter_gallery__transition_perf.dart
View file @
abebd8b7
...
...
@@ -6,7 +6,7 @@ import 'package:flutter_devicelab/framework/devices.dart';
import
'package:flutter_devicelab/framework/framework.dart'
;
import
'package:flutter_devicelab/tasks/gallery.dart'
;
Future
<
void
>
main
()
async
{
Future
<
void
>
main
(
List
<
String
>
args
)
async
{
deviceOperatingSystem
=
DeviceOperatingSystem
.
android
;
await
task
(
createGalleryTransition
Test
(
));
await
task
(
createGalleryTransition
BuildTest
(
args
));
}
dev/devicelab/lib/tasks/gallery.dart
View file @
abebd8b7
...
...
@@ -10,6 +10,16 @@ import '../framework/devices.dart';
import
'../framework/framework.dart'
;
import
'../framework/task_result.dart'
;
import
'../framework/utils.dart'
;
import
'build_test_task.dart'
;
final
Directory
galleryDirectory
=
dir
(
'
${flutterDirectory.path}
/dev/integration_tests/flutter_gallery'
);
/// Temp function during gallery tests transition to build+test model.
///
/// https://github.com/flutter/flutter/issues/103542
TaskFunction
createGalleryTransitionBuildTest
(
List
<
String
>
args
,
{
bool
semanticsEnabled
=
false
})
{
return
GalleryTransitionBuildTest
(
args
,
semanticsEnabled:
semanticsEnabled
);
}
TaskFunction
createGalleryTransitionTest
(
{
bool
semanticsEnabled
=
false
})
{
return
GalleryTransitionTest
(
semanticsEnabled:
semanticsEnabled
);
...
...
@@ -176,6 +186,137 @@ class GalleryTransitionTest {
}
}
class
GalleryTransitionBuildTest
extends
BuildTestTask
{
GalleryTransitionBuildTest
(
super
.
args
,
{
this
.
semanticsEnabled
=
false
,
this
.
testFile
=
'transitions_perf'
,
this
.
needFullTimeline
=
true
,
this
.
timelineSummaryFile
=
'transitions.timeline_summary'
,
this
.
timelineTraceFile
=
'transitions.timeline'
,
this
.
transitionDurationFile
=
'transition_durations.timeline'
,
this
.
driverFile
,
this
.
measureCpuGpu
=
true
,
this
.
measureMemory
=
true
,
})
:
super
(
workingDirectory:
galleryDirectory
);
final
bool
semanticsEnabled
;
final
bool
needFullTimeline
;
final
bool
measureCpuGpu
;
final
bool
measureMemory
;
final
String
testFile
;
final
String
timelineSummaryFile
;
final
String
?
timelineTraceFile
;
final
String
?
transitionDurationFile
;
final
String
?
driverFile
;
final
String
testOutputDirectory
=
Platform
.
environment
[
'FLUTTER_TEST_OUTPUTS_DIR'
]
??
'
${galleryDirectory.path}
/build'
;
@override
List
<
String
>
getBuildArgs
(
DeviceOperatingSystem
deviceOperatingSystem
)
{
return
<
String
>[
'apk'
,
'--no-android-gradle-daemon'
,
'--profile'
,
'-t'
,
'test_driver/
$testFile
.dart'
,
'--target-platform'
,
'android-arm,android-arm64'
,
];
}
@override
List
<
String
>
getTestArgs
(
DeviceOperatingSystem
deviceOperatingSystem
,
String
deviceId
)
{
final
String
testDriver
=
driverFile
??
(
semanticsEnabled
?
'
${testFile}
_with_semantics_test'
:
'
${testFile}
_test'
);
return
<
String
>[
'--profile'
,
if
(
needFullTimeline
)
'--trace-startup'
,
'-t'
,
'test_driver/
$testFile
.dart'
,
'--use-application-binary=
${getApplicationBinaryPath()}
'
,
'--driver'
,
'test_driver/
$testDriver
.dart'
,
'-d'
,
deviceId
,
];
}
@override
Future
<
TaskResult
>
parseTaskResult
()
async
{
final
Map
<
String
,
dynamic
>
summary
=
json
.
decode
(
file
(
'
$testOutputDirectory
/
$timelineSummaryFile
.json'
).
readAsStringSync
(),
)
as
Map
<
String
,
dynamic
>;
if
(
transitionDurationFile
!=
null
)
{
final
Map
<
String
,
dynamic
>
original
=
json
.
decode
(
file
(
'
$testOutputDirectory
/
$transitionDurationFile
.json'
).
readAsStringSync
(),
)
as
Map
<
String
,
dynamic
>;
final
Map
<
String
,
List
<
int
>>
transitions
=
<
String
,
List
<
int
>>{};
for
(
final
String
key
in
original
.
keys
)
{
transitions
[
key
]
=
List
<
int
>.
from
(
original
[
key
]
as
List
<
dynamic
>);
}
summary
[
'transitions'
]
=
transitions
;
summary
[
'missed_transition_count'
]
=
_countMissedTransitions
(
transitions
);
}
final
bool
isAndroid
=
deviceOperatingSystem
==
DeviceOperatingSystem
.
android
;
return
TaskResult
.
success
(
summary
,
detailFiles:
<
String
>[
if
(
transitionDurationFile
!=
null
)
'
$testOutputDirectory
/
$transitionDurationFile
.json'
,
if
(
timelineTraceFile
!=
null
)
'
$testOutputDirectory
/
$timelineTraceFile
.json'
,
],
benchmarkScoreKeys:
<
String
>[
if
(
transitionDurationFile
!=
null
)
'missed_transition_count'
,
'average_frame_build_time_millis'
,
'worst_frame_build_time_millis'
,
'90th_percentile_frame_build_time_millis'
,
'99th_percentile_frame_build_time_millis'
,
'average_frame_rasterizer_time_millis'
,
'worst_frame_rasterizer_time_millis'
,
'90th_percentile_frame_rasterizer_time_millis'
,
'99th_percentile_frame_rasterizer_time_millis'
,
'average_layer_cache_count'
,
'90th_percentile_layer_cache_count'
,
'99th_percentile_layer_cache_count'
,
'worst_layer_cache_count'
,
'average_layer_cache_memory'
,
'90th_percentile_layer_cache_memory'
,
'99th_percentile_layer_cache_memory'
,
'worst_layer_cache_memory'
,
'average_picture_cache_count'
,
'90th_percentile_picture_cache_count'
,
'99th_percentile_picture_cache_count'
,
'worst_picture_cache_count'
,
'average_picture_cache_memory'
,
'90th_percentile_picture_cache_memory'
,
'99th_percentile_picture_cache_memory'
,
'worst_picture_cache_memory'
,
if
(
measureCpuGpu
&&
!
isAndroid
)
...<
String
>[
// See https://github.com/flutter/flutter/issues/68888
if
(
summary
[
'average_cpu_usage'
]
!=
null
)
'average_cpu_usage'
,
if
(
summary
[
'average_gpu_usage'
]
!=
null
)
'average_gpu_usage'
,
],
if
(
measureMemory
&&
!
isAndroid
)
...<
String
>[
// See https://github.com/flutter/flutter/issues/68888
if
(
summary
[
'average_memory_usage'
]
!=
null
)
'average_memory_usage'
,
if
(
summary
[
'90th_percentile_memory_usage'
]
!=
null
)
'90th_percentile_memory_usage'
,
if
(
summary
[
'99th_percentile_memory_usage'
]
!=
null
)
'99th_percentile_memory_usage'
,
],
],
);
}
@override
String
getApplicationBinaryPath
()
{
if
(
applicationBinaryPath
!=
null
)
{
return
applicationBinaryPath
!;
}
return
'build/app/outputs/flutter-apk/app-profile.apk'
;
}
}
int
_countMissedTransitions
(
Map
<
String
,
List
<
int
>>
transitions
)
{
const
int
kTransitionBudget
=
100000
;
// µs
int
count
=
0
;
...
...
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