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
61460d25
Unverified
Commit
61460d25
authored
Nov 18, 2020
by
Jim Graham
Committed by
GitHub
Nov 18, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
preserve detailFiles entry in TaskResult JSON (#70668)
* preserve detailFiles entry in TaskResult JSON
parent
4cbafda8
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
24 additions
and
19 deletions
+24
-19
task_result.dart
dev/devicelab/lib/framework/task_result.dart
+12
-7
gallery.dart
dev/devicelab/lib/tasks/gallery.dart
+6
-7
perf_tests.dart
dev/devicelab/lib/tasks/perf_tests.dart
+4
-5
task_result_test.dart
dev/devicelab/test/task_result_test.dart
+2
-0
No files found.
dev/devicelab/lib/framework/task_result.dart
View file @
61460d25
...
...
@@ -10,7 +10,7 @@ class TaskResult {
/// Constructs a successful result.
TaskResult
.
success
(
this
.
data
,
{
this
.
benchmarkScoreKeys
=
const
<
String
>[],
this
.
detailFiles
,
this
.
detailFiles
=
const
<
String
>[]
,
})
:
succeeded
=
true
,
message
=
'success'
{
...
...
@@ -29,11 +29,14 @@ class TaskResult {
}
/// Constructs a successful result using JSON data stored in a file.
factory
TaskResult
.
successFromFile
(
File
file
,
{
List
<
String
>
benchmarkScoreKeys
})
{
factory
TaskResult
.
successFromFile
(
File
file
,
{
List
<
String
>
benchmarkScoreKeys
=
const
<
String
>[],
List
<
String
>
detailFiles
=
const
<
String
>[],
})
{
return
TaskResult
.
success
(
json
.
decode
(
file
.
readAsStringSync
())
as
Map
<
String
,
dynamic
>,
benchmarkScoreKeys:
benchmarkScoreKeys
,
detailFiles:
detailFiles
,
);
}
...
...
@@ -42,8 +45,11 @@ class TaskResult {
final
bool
success
=
json
[
'success'
]
as
bool
;
if
(
success
)
{
final
List
<
String
>
benchmarkScoreKeys
=
(
json
[
'benchmarkScoreKeys'
]
as
List
<
dynamic
>
??
<
String
>[]).
cast
<
String
>();
final
List
<
String
>
detailFiles
=
(
json
[
'detailFiles'
]
as
List
<
dynamic
>
??
<
String
>[]).
cast
<
String
>();
return
TaskResult
.
success
(
json
[
'data'
]
as
Map
<
String
,
dynamic
>,
benchmarkScoreKeys:
benchmarkScoreKeys
);
benchmarkScoreKeys:
benchmarkScoreKeys
,
detailFiles:
detailFiles
,
);
}
return
TaskResult
.
failure
(
json
[
'reason'
]
as
String
);
...
...
@@ -54,7 +60,7 @@ class TaskResult {
:
succeeded
=
false
,
data
=
null
,
detailFiles
=
null
,
benchmarkScoreKeys
=
const
<
String
>[]
;
benchmarkScoreKeys
=
null
;
/// Whether the task succeeded.
final
bool
succeeded
;
...
...
@@ -98,8 +104,7 @@ class TaskResult {
if
(
succeeded
)
{
json
[
'data'
]
=
data
;
if
(
detailFiles
!=
null
)
json
[
'detailFiles'
]
=
detailFiles
;
json
[
'detailFiles'
]
=
detailFiles
;
json
[
'benchmarkScoreKeys'
]
=
benchmarkScoreKeys
;
}
else
{
json
[
'reason'
]
=
message
;
...
...
dev/devicelab/lib/tasks/gallery.dart
View file @
61460d25
...
...
@@ -119,15 +119,14 @@ class GalleryTransitionTest {
summary
[
'transitions'
]
=
transitions
;
summary
[
'missed_transition_count'
]
=
_countMissedTransitions
(
transitions
);
}
final
List
<
String
>
detailFiles
=
<
String
>[
if
(
transitionDurationFile
!=
null
)
'
${galleryDirectory.path}
/build/
$transitionDurationFile
.json'
,
if
(
timelineTraceFile
!=
null
)
'
${galleryDirectory.path}
/build/
$timelineTraceFile
.json'
];
return
TaskResult
.
success
(
summary
,
detailFiles:
detailFiles
.
isNotEmpty
?
detailFiles
:
null
,
detailFiles:
<
String
>[
if
(
transitionDurationFile
!=
null
)
'
${galleryDirectory.path}
/build/
$transitionDurationFile
.json'
,
if
(
timelineTraceFile
!=
null
)
'
${galleryDirectory.path}
/build/
$timelineTraceFile
.json'
],
benchmarkScoreKeys:
<
String
>[
if
(
transitionDurationFile
!=
null
)
'missed_transition_count'
,
...
...
dev/devicelab/lib/tasks/perf_tests.dart
View file @
61460d25
...
...
@@ -640,10 +640,6 @@ class PerfTest {
final
Map
<
String
,
dynamic
>
data
=
json
.
decode
(
file
(
'
$testDirectory
/build/
$resultFilename
.json'
).
readAsStringSync
(),
)
as
Map
<
String
,
dynamic
>;
final
List
<
String
>
detailFiles
=
<
String
>[
if
(
saveTraceFile
)
'
$testDirectory
/build/
$traceFilename
.json'
,
];
if
(
data
[
'frame_count'
]
as
int
<
5
)
{
return
TaskResult
.
failure
(
...
...
@@ -657,7 +653,10 @@ class PerfTest {
final
bool
isAndroid
=
deviceOperatingSystem
==
DeviceOperatingSystem
.
android
;
return
TaskResult
.
success
(
data
,
detailFiles:
detailFiles
.
isNotEmpty
?
detailFiles
:
null
,
detailFiles:
<
String
>[
if
(
saveTraceFile
)
'
$testDirectory
/build/
$traceFilename
.json'
,
],
benchmarkScoreKeys:
benchmarkScoreKeys
??
<
String
>[
...
_kCommonScoreKeys
,
'average_vsync_transitions_missed'
,
...
...
dev/devicelab/test/task_result_test.dart
View file @
61460d25
...
...
@@ -17,6 +17,7 @@ void main() {
'not_a_metric'
:
'something'
,
},
'benchmarkScoreKeys'
:
<
String
>[
'i'
,
'j'
],
'detailFiles'
:
<
String
>[],
};
final
TaskResult
result
=
TaskResult
.
fromJson
(
expectedJson
);
expect
(
result
.
toJson
(),
expectedJson
);
...
...
@@ -30,6 +31,7 @@ void main() {
'success'
:
true
,
'data'
:
null
,
'benchmarkScoreKeys'
:
<
String
>[],
'detailFiles'
:
<
String
>[],
};
expect
(
result
.
toJson
(),
expectedJson
);
});
...
...
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