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
bc3ca10e
Unverified
Commit
bc3ca10e
authored
Jun 07, 2019
by
Dan Field
Committed by
GitHub
Jun 07, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make it easier to pass local engine flags when running devicelab tests (#34054)
parent
227ffb58
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
49 additions
and
5 deletions
+49
-5
run.dart
dev/devicelab/bin/run.dart
+21
-1
runner.dart
dev/devicelab/lib/framework/runner.dart
+8
-1
utils.dart
dev/devicelab/lib/framework/utils.dart
+19
-2
pubspec.yaml
dev/devicelab/pubspec.yaml
+1
-1
No files found.
dev/devicelab/bin/run.dart
View file @
bc3ca10e
...
...
@@ -54,10 +54,17 @@ Future<void> main(List<String> rawArgs) async {
}
final
bool
silent
=
args
[
'silent'
];
final
String
localEngine
=
args
[
'local-engine'
];
final
String
localEngineSrcPath
=
args
[
'local-engine-src-path'
];
for
(
String
taskName
in
_taskNames
)
{
section
(
'Running task "
$taskName
"'
);
final
Map
<
String
,
dynamic
>
result
=
await
runTask
(
taskName
,
silent:
silent
);
final
Map
<
String
,
dynamic
>
result
=
await
runTask
(
taskName
,
silent:
silent
,
localEngine:
localEngine
,
localEngineSrcPath:
localEngineSrcPath
,
);
if
(!
result
[
'success'
])
exitCode
=
1
;
...
...
@@ -123,6 +130,19 @@ final ArgParser _argParser = ArgParser()
'silent'
,
negatable:
true
,
defaultsTo:
false
,
)
..
addOption
(
'local-engine'
,
help:
'Name of a build output within the engine out directory, if you are '
'building Flutter locally. Use this to select a specific version of '
'the engine if you have built multiple engine targets. This path is '
'relative to --local-engine-src-path/out.'
,
)
..
addOption
(
'local-engine-src-path'
,
help:
'Path to your engine src directory, if you are building Flutter '
'locally. Defaults to
\
$FLUTTER_ENGINE
if set, or tries to guess at '
'the location based on the value of the --flutter-root option.'
,
);
bool
_listsEqual
(
List
<
dynamic
>
a
,
List
<
dynamic
>
b
)
{
...
...
dev/devicelab/lib/framework/runner.dart
View file @
bc3ca10e
...
...
@@ -23,7 +23,12 @@ const Duration taskTimeoutWithGracePeriod = Duration(minutes: 26);
///
/// Running the task in [silent] mode will suppress standard output from task
/// processes and only print standard errors.
Future
<
Map
<
String
,
dynamic
>>
runTask
(
String
taskName
,
{
bool
silent
=
false
})
async
{
Future
<
Map
<
String
,
dynamic
>>
runTask
(
String
taskName
,
{
bool
silent
=
false
,
String
localEngine
,
String
localEngineSrcPath
,
})
async
{
final
String
taskExecutable
=
'bin/tasks/
$taskName
.dart'
;
if
(!
file
(
taskExecutable
).
existsSync
())
...
...
@@ -32,6 +37,8 @@ Future<Map<String, dynamic>> runTask(String taskName, { bool silent = false }) a
final
Process
runner
=
await
startProcess
(
dartBin
,
<
String
>[
'--enable-vm-service=0'
,
// zero causes the system to choose a free port
'--no-pause-isolates-on-exit'
,
if
(
localEngine
!=
null
)
'-DlocalEngine=
$localEngine
'
,
if
(
localEngineSrcPath
!=
null
)
'-DlocalEngineSrcPath=
$localEngineSrcPath
'
,
taskExecutable
,
]);
...
...
dev/devicelab/lib/framework/utils.dart
View file @
bc3ca10e
...
...
@@ -18,6 +18,13 @@ import 'adb.dart';
/// Virtual current working directory, which affect functions, such as [exec].
String
cwd
=
Directory
.
current
.
path
;
/// The local engine to use for [flutter] and [evalFlutter], if any.
String
get
localEngine
=>
const
String
.
fromEnvironment
(
'localEngine'
);
/// The local engine source path to use if a local engine is used for [flutter]
/// and [evalFlutter].
String
get
localEngineSrcPath
=>
const
String
.
fromEnvironment
(
'localEngineSrcPath'
);
List
<
ProcessInfo
>
_runningProcesses
=
<
ProcessInfo
>[];
ProcessManager
_processManager
=
const
LocalProcessManager
();
...
...
@@ -339,7 +346,12 @@ Future<int> flutter(String command, {
bool
canFail
=
false
,
// as in, whether failures are ok. False means that they are fatal.
Map
<
String
,
String
>
environment
,
})
{
final
List
<
String
>
args
=
<
String
>[
command
]..
addAll
(
options
);
final
List
<
String
>
args
=
<
String
>[
command
,
if
(
localEngine
!=
null
)
...<
String
>[
'--local-engine'
,
localEngine
],
if
(
localEngineSrcPath
!=
null
)
...<
String
>[
'--local-engine-src-path'
,
localEngineSrcPath
],
...
options
,
];
return
exec
(
path
.
join
(
flutterDirectory
.
path
,
'bin'
,
'flutter'
),
args
,
canFail:
canFail
,
environment:
environment
);
}
...
...
@@ -351,7 +363,12 @@ Future<String> evalFlutter(String command, {
Map
<
String
,
String
>
environment
,
StringBuffer
stderr
,
// if not null, the stderr will be written here.
})
{
final
List
<
String
>
args
=
<
String
>[
command
]..
addAll
(
options
);
final
List
<
String
>
args
=
<
String
>[
command
,
if
(
localEngine
!=
null
)
...<
String
>[
'--local-engine'
,
localEngine
],
if
(
localEngineSrcPath
!=
null
)
...<
String
>[
'--local-engine-src-path'
,
localEngineSrcPath
],
...
options
,
];
return
eval
(
path
.
join
(
flutterDirectory
.
path
,
'bin'
,
'flutter'
),
args
,
canFail:
canFail
,
environment:
environment
,
stderr:
stderr
);
}
...
...
dev/devicelab/pubspec.yaml
View file @
bc3ca10e
...
...
@@ -5,7 +5,7 @@ homepage: https://github.com/flutter/flutter
environment
:
# The pub client defaults to an <2.0.0 sdk constraint which we need to explicitly overwrite.
sdk
:
"
>=2.
0.0-dev.68.0
<3.0.0"
sdk
:
"
>=2.
2.2
<3.0.0"
dependencies
:
args
:
1.5.2
...
...
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