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
e778686e
Unverified
Commit
e778686e
authored
Oct 29, 2019
by
Jonah Williams
Committed by
GitHub
Oct 29, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Re-enable chrome dev mode tests (#43691)
parent
2637a6cb
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
159 additions
and
150 deletions
+159
-150
web_dev_mode_tests.dart
dev/devicelab/lib/tasks/web_dev_mode_tests.dart
+141
-130
manifest.yaml
dev/devicelab/manifest.yaml
+18
-20
No files found.
dev/devicelab/lib/tasks/web_dev_mode_tests.dart
View file @
e778686e
...
...
@@ -9,30 +9,24 @@ import 'dart:io';
import
'package:path/path.dart'
as
path
;
import
'../framework/framework.dart'
;
import
'../framework/running_processes.dart'
;
import
'../framework/utils.dart'
;
final
Directory
_editedFlutterGalleryDir
=
dir
(
path
.
join
(
Directory
.
systemTemp
.
path
,
'edited_flutter_gallery'
));
final
Directory
flutterGalleryDir
=
dir
(
path
.
join
(
flutterDirectory
.
path
,
'examples/flutter_gallery'
));
const
String
kInitialStartupTime
=
'InitialStartupTime'
;
const
String
kFirstRestartTime
=
'FistRestartTime'
;
const
String
kFirstRecompileTime
=
'FirstRecompileTime'
;
const
String
kSecondStartupTime
=
'SecondStartupTime'
;
const
String
kSecondRestartTime
=
'SecondRestartTime'
;
TaskFunction
createWebDevModeTest
(
)
{
return
()
async
{
final
List
<
String
>
options
=
<
String
>[
'--hot'
,
'-d'
,
'
chrome
'
,
'--verbose'
,
'--resident'
,
'--target=lib/main.dart'
,
'--hot'
,
'-d'
,
'
web-server
'
,
'--verbose'
,
'--resident'
,
'--target=lib/main.dart'
,
];
int
hotRestartCount
=
0
;
String
chromeProcessName
;
if
(
Platform
.
isMacOS
)
{
chromeProcessName
=
'Chrome'
;
}
else
if
(
Platform
.
isLinux
)
{
chromeProcessName
=
'chrome'
;
}
else
if
(
Platform
.
isWindows
)
{
chromeProcessName
=
'chrome.exe'
;
}
final
Set
<
String
>
beforeChromeProcesses
=
await
getRunningProcesses
(
processName:
chromeProcessName
)
.
map
((
RunningProcessInfo
info
)
=>
info
.
pid
)
.
toSet
();
try
{
final
Map
<
String
,
int
>
measurements
=
<
String
,
int
>{};
await
inDirectory
<
void
>(
flutterDirectory
,
()
async
{
rmTree
(
_editedFlutterGalleryDir
);
mkdirs
(
_editedFlutterGalleryDir
);
...
...
@@ -57,15 +51,23 @@ TaskFunction createWebDevModeTest() {
final
Completer
<
void
>
stdoutDone
=
Completer
<
void
>();
final
Completer
<
void
>
stderrDone
=
Completer
<
void
>();
final
Stopwatch
sw
=
Stopwatch
()..
start
();
process
.
stdout
.
transform
<
String
>(
utf8
.
decoder
)
.
transform
<
String
>(
const
LineSplitter
())
.
listen
((
String
line
)
{
if
(
line
.
contains
(
'To hot restart'
))
{
// measure clean start-up time.
sw
.
stop
();
measurements
[
kInitialStartupTime
]
=
sw
.
elapsedMilliseconds
;
sw
..
reset
()
..
start
();
process
.
stdin
.
write
(
'R'
);
}
if
(
line
.
contains
(
'Restarted
'
))
{
if
(
line
.
contains
(
'Recompile complete
'
))
{
if
(
hotRestartCount
==
0
)
{
measurements
[
kFirstRestartTime
]
=
sw
.
elapsedMilliseconds
;
// Update the file and reload again.
final
File
appDartSource
=
file
(
path
.
join
(
_editedFlutterGalleryDir
.
path
,
'lib/gallery/app.dart'
,
...
...
@@ -75,9 +77,13 @@ TaskFunction createWebDevModeTest() {
"'Flutter Gallery'"
,
"'Updated Flutter Gallery'"
,
)
);
sw
..
reset
()
..
start
();
process
.
stdin
.
writeln
(
'R'
);
++
hotRestartCount
;
}
else
{
measurements
[
kFirstRecompileTime
]
=
sw
.
elapsedMilliseconds
;
// Quit after second hot restart.
process
.
stdin
.
writeln
(
'q'
);
}
...
...
@@ -106,6 +112,8 @@ TaskFunction createWebDevModeTest() {
// Start `flutter run` again to make sure it loads from the previous
// state. dev compilers loads up from previously compiled JavaScript.
{
final
Stopwatch
sw
=
Stopwatch
()..
start
();
final
Process
process
=
await
startProcess
(
path
.
join
(
flutterDirectory
.
path
,
'bin'
,
'flutter'
),
flutterCommandArgs
(
'run'
,
options
),
...
...
@@ -119,10 +127,16 @@ TaskFunction createWebDevModeTest() {
.
transform
<
String
>(
utf8
.
decoder
)
.
transform
<
String
>(
const
LineSplitter
())
.
listen
((
String
line
)
{
if
(
line
.
contains
(
'To hot restart'
))
{
measurements
[
kSecondStartupTime
]
=
sw
.
elapsedMilliseconds
;
sw
..
reset
()
..
start
();
process
.
stdin
.
write
(
'R'
);
}
if
(
line
.
contains
(
'Restarted'
))
{
if
(
line
.
contains
(
'Recompile complete'
))
{
measurements
[
kSecondRestartTime
]
=
sw
.
elapsedMilliseconds
;
process
.
stdin
.
writeln
(
'q'
);
}
print
(
'stdout:
$line
'
);
...
...
@@ -146,18 +160,15 @@ TaskFunction createWebDevModeTest() {
}
});
});
}
finally
{
final
Set
<
String
>
afterChromeProcesses
=
await
getRunningProcesses
(
processName:
chromeProcessName
)
.
map
((
RunningProcessInfo
info
)
=>
info
.
pid
)
.
toSet
();
final
Set
<
String
>
newProcesses
=
afterChromeProcesses
.
difference
(
beforeChromeProcesses
);
for
(
String
processId
in
newProcesses
)
{
await
killProcess
(
processId
);
}
}
if
(
hotRestartCount
!=
1
)
{
return
TaskResult
.
failure
(
null
);
}
return
TaskResult
.
success
(
null
);
return
TaskResult
.
success
(
measurements
,
benchmarkScoreKeys:
<
String
>[
kInitialStartupTime
,
kFirstRestartTime
,
kFirstRecompileTime
,
kSecondStartupTime
,
kSecondRestartTime
,
]);
};
}
dev/devicelab/manifest.yaml
View file @
e778686e
...
...
@@ -126,13 +126,12 @@ tasks:
stage
:
devicelab_win
required_agent_capabilities
:
[
"
windows/android"
]
# TODO(jonahwilliams): re-enable with https://github.com/flutter/flutter/issues/39597
# windows_chrome_dev_mode:
# description: >
# Run flutter web on the devicelab and hot restart.
# stage: devicelab_win
# required_agent_capabilities: ["windows/android"]
# flaky: true
windows_chrome_dev_mode
:
description
:
>
Run flutter web on the devicelab and hot restart.
stage
:
devicelab_win
required_agent_capabilities
:
[
"
windows/android"
]
flaky
:
true
# Android on-device tests
...
...
@@ -346,13 +345,12 @@ tasks:
stage
:
devicelab
required_agent_capabilities
:
[
"
linux/android"
]
# TODO(jonahwilliams): re-enable with https://github.com/flutter/flutter/issues/39597
# linux_chrome_dev_mode:
# description: >
# Run flutter web on the devicelab and hot restart.
# stage: devicelab
# required_agent_capabilities: ["linux/android"]
# flaky: true
linux_chrome_dev_mode
:
description
:
>
Run flutter web on the devicelab and hot restart.
stage
:
devicelab
required_agent_capabilities
:
[
"
linux/android"
]
flaky
:
true
web_size__compile_test
:
description
:
>
...
...
@@ -519,12 +517,12 @@ tasks:
stage
:
devicelab_ios
required_agent_capabilities
:
[
"
mac/ios"
]
#
macos_chrome_dev_mode:
#
description: >
#
Run flutter web on the devicelab and hot restart.
#
stage: devicelab_ios
#
required_agent_capabilities: ["mac/ios"]
#
flaky: true # marked as flaky while infra is under heavy development
macos_chrome_dev_mode
:
description
:
>
Run flutter web on the devicelab and hot restart.
stage
:
devicelab_ios
required_agent_capabilities
:
[
"
mac/ios"
]
flaky
:
true
# marked as flaky while infra is under heavy development
build_benchmark_ios
:
description
:
>
...
...
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