Update dev/devicelab/** to provide --local-engine-host. (#132342)

Partial work towards https://github.com/flutter/flutter/issues/132245.

I have to admit I don't totally understand what I've updated, or whether
there are more integration points needed.
This commit is contained in:
Matan Lurey
2023-08-10 17:25:30 -07:00
committed by GitHub
parent 978461c54e
commit a7997f606e
11 changed files with 77 additions and 7 deletions

View File

@@ -38,6 +38,11 @@ Future<void> main(List<String> rawArgs) async {
/// Required for A/B test mode.
final String? localEngine = args['local-engine'] as String?;
/// The build of the local engine to use as the host platform.
///
/// Required if [localEngine] is set.
final String? localEngineHost = args['local-engine-host'] as String?;
/// The build of the local Web SDK to use.
///
/// Required for A/B test mode.
@@ -95,10 +100,16 @@ Future<void> main(List<String> rawArgs) async {
stderr.writeln(argParser.usage);
exit(1);
}
if (localEngineHost == null) {
stderr.writeln('When running in A/B test mode --local-engine-host is required.\n');
stderr.writeln(argParser.usage);
exit(1);
}
await _runABTest(
runsPerTest: runsPerTest,
silent: silent,
localEngine: localEngine,
localEngineHost: localEngineHost,
localWebSdk: localWebSdk,
localEngineSrcPath: localEngineSrcPath,
deviceId: deviceId,
@@ -125,6 +136,7 @@ Future<void> _runABTest({
required int runsPerTest,
required bool silent,
required String? localEngine,
required String localEngineHost,
required String? localWebSdk,
required String? localEngineSrcPath,
required String? deviceId,
@@ -135,7 +147,11 @@ Future<void> _runABTest({
assert(localEngine != null || localWebSdk != null);
final ABTest abTest = ABTest((localEngine ?? localWebSdk)!, taskName);
final ABTest abTest = ABTest(
localEngine: (localEngine ?? localWebSdk)!,
localEngineHost: localEngineHost,
taskName: taskName,
);
for (int i = 1; i <= runsPerTest; i++) {
section('Run #$i');
@@ -292,6 +308,15 @@ ArgParser createArgParser(List<String> taskNames) {
'This path is relative to --local-engine-src-path/out. This option\n'
'is required when running an A/B test (see the --ab option).',
)
..addOption(
'local-engine-host',
help: 'Name of a build output within the engine out directory, if you\n'
'are building Flutter locally. Use this to select a specific\n'
'version of the engine to use as the host platform if you have built '
'multiple engine targets.\n'
'This path is relative to --local-engine-src-path/out. This option\n'
'is required when running an A/B test (see the --ab option).',
)
..addOption(
'local-web-sdk',
help: 'Name of a build output within the engine out directory, if you\n'