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
d5d82650
Unverified
Commit
d5d82650
authored
Aug 20, 2021
by
Dan Field
Committed by
GitHub
Aug 20, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert "Write timelines to separate files (#88473)" (#88594)
This reverts commit
fa83fefa
.
parent
a7f8687d
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
48 deletions
+8
-48
integration_test.dart
packages/integration_test/lib/integration_test.dart
+0
-7
integration_test_driver.dart
packages/integration_test/lib/integration_test_driver.dart
+8
-14
multi_timeline_test.dart
packages/integration_test/test/multi_timeline_test.dart
+0
-27
No files found.
packages/integration_test/lib/integration_test.dart
View file @
d5d82650
...
...
@@ -297,19 +297,12 @@ https://flutter.dev/docs/testing/integration-tests#testing-on-firebase-test-lab
///
/// The `streams` and `retainPriorEvents` parameters are passed as-is to
/// [traceTimeline].
///
/// The `reportKey` must not be `'screenshots'`, which is reserved for
/// screenshots created by
/// [IntegrationTestWidgetsFlutterBinding.takeScreenshot].
Future
<
void
>
traceAction
(
Future
<
dynamic
>
Function
()
action
,
{
List
<
String
>
streams
=
const
<
String
>[
'all'
],
bool
retainPriorEvents
=
false
,
String
reportKey
=
'timeline'
,
})
async
{
if
(
reportKey
==
'screenshots'
)
{
throw
ArgumentError
(
'The "screenshots" reportKey is reserved.'
);
}
final
vm
.
Timeline
timeline
=
await
traceTimeline
(
action
,
streams:
streams
,
...
...
packages/integration_test/lib/integration_test_driver.dart
View file @
d5d82650
...
...
@@ -24,8 +24,7 @@ String testOutputsDirectory =
typedef
ResponseDataCallback
=
FutureOr
<
void
>
Function
(
Map
<
String
,
dynamic
>?);
/// Writes a json-serializable data to
/// [testOutputsDirectory]/`testOutputFilename_<key>.json`, where key is the
/// name provided as the report key for the response data.
/// [testOutputsDirectory]/`testOutputFilename.json`.
///
/// This is the default `responseDataCallback` in [integrationDriver].
Future
<
void
>
writeResponseData
(
...
...
@@ -33,20 +32,15 @@ Future<void> writeResponseData(
String
testOutputFilename
=
'integration_response_data'
,
String
?
destinationDirectory
,
})
async
{
if
(
data
==
null
)
{
return
;
}
assert
(
testOutputFilename
!=
null
);
destinationDirectory
??=
testOutputsDirectory
;
await
fs
.
directory
(
destinationDirectory
).
create
(
recursive:
true
);
for
(
final
String
key
in
data
.
keys
.
where
((
String
key
)
=>
key
!=
'screenshots'
))
{
final
File
file
=
fs
.
file
(
path
.
join
(
destinationDirectory
,
'
${testOutputFilename}
_
$key
.json'
,
));
final
String
resultString
=
_encodeJson
(
data
[
key
],
true
);
await
file
.
writeAsString
(
resultString
);
}
final
File
file
=
fs
.
file
(
path
.
join
(
destinationDirectory
,
'
$testOutputFilename
.json'
,
));
final
String
resultString
=
_encodeJson
(
data
,
true
);
await
file
.
writeAsString
(
resultString
);
}
/// Adaptor to run an integration test using `flutter drive`.
...
...
@@ -101,6 +95,6 @@ Future<void> integrationDriver({
const
JsonEncoder
_prettyEncoder
=
JsonEncoder
.
withIndent
(
' '
);
String
_encodeJson
(
Object
?
jsonObject
,
bool
pretty
)
{
String
_encodeJson
(
Map
<
String
,
dynamic
>
?
jsonObject
,
bool
pretty
)
{
return
pretty
?
_prettyEncoder
.
convert
(
jsonObject
)
:
json
.
encode
(
jsonObject
);
}
packages/integration_test/test/multi_timeline_test.dart
deleted
100644 → 0
View file @
a7f8687d
// Copyright 2014 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import
'package:flutter_driver/flutter_driver.dart'
;
import
'package:flutter_test/flutter_test.dart'
;
import
'package:integration_test/integration_test_driver.dart'
;
import
'package:path/path.dart'
as
path
;
void
main
(
)
{
useMemoryFileSystemForTesting
();
test
(
'Writes multiple files for each timeline'
,
()
async
{
final
String
outDir
=
fs
.
systemTempDirectory
.
path
;
await
writeResponseData
(
<
String
,
dynamic
>{
'timeline_a'
:
<
String
,
dynamic
>{},
'timeline_b'
:
<
String
,
dynamic
>{},
'screenshots'
:
<
String
,
dynamic
>{},
},
destinationDirectory:
outDir
,
);
expect
(
fs
.
file
(
path
.
join
(
outDir
,
'integration_response_data_timeline_a.json'
)).
existsSync
(),
true
);
expect
(
fs
.
file
(
path
.
join
(
outDir
,
'integration_response_data_timeline_b.json'
)).
existsSync
(),
true
);
expect
(
fs
.
file
(
path
.
join
(
outDir
,
'integration_response_data_screenshots.json'
)).
existsSync
(),
false
);
});
}
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