From 491ba2307fba0762b9f5541a0e34a8667f13b574 Mon Sep 17 00:00:00 2001 From: Matan Lurey Date: Mon, 14 Aug 2023 13:21:14 -0700 Subject: [PATCH] Update `dev/bots/test.dart` (and friends) to provide `--local-engine-host`. (#132354) Partial work towards https://github.com/flutter/flutter/issues/132245. As far as I can tell, this just plumbs flags downwards and has no semantic changes. --- dev/bots/test.dart | 5 ++++- packages/flutter_tools/README.md | 12 +++++++----- .../test/integration.shard/test_utils.dart | 3 +++ 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/dev/bots/test.dart b/dev/bots/test.dart index 2b48df03287..8408e452d49 100644 --- a/dev/bots/test.dart +++ b/dev/bots/test.dart @@ -213,7 +213,7 @@ String get shuffleSeed { /// /// Examples: /// SHARD=tool_tests bin/cache/dart-sdk/bin/dart dev/bots/test.dart -/// bin/cache/dart-sdk/bin/dart dev/bots/test.dart --local-engine=host_debug_unopt +/// bin/cache/dart-sdk/bin/dart dev/bots/test.dart --local-engine=host_debug_unopt --local-engine-host=host_debug_unopt Future main(List args) async { try { printProgress('STARTING ANALYSIS'); @@ -221,6 +221,9 @@ Future main(List args) async { if (arg.startsWith('--local-engine=')) { localEngineEnv['FLUTTER_LOCAL_ENGINE'] = arg.substring('--local-engine='.length); flutterTestArgs.add(arg); + } else if (arg.startsWith('--local-engine-host=')) { + localEngineEnv['FLUTTER_LOCAL_ENGINE_HOST'] = arg.substring('--local-engine-host='.length); + flutterTestArgs.add(arg); } else if (arg.startsWith('--local-engine-src-path=')) { localEngineEnv['FLUTTER_LOCAL_ENGINE_SRC_PATH'] = arg.substring('--local-engine-src-path='.length); flutterTestArgs.add(arg); diff --git a/packages/flutter_tools/README.md b/packages/flutter_tools/README.md index c52201c29cb..606eacfb3ad 100644 --- a/packages/flutter_tools/README.md +++ b/packages/flutter_tools/README.md @@ -67,14 +67,16 @@ Please avoid setting any other timeouts. #### Using local engine builds in integration tests The integration tests can be configured to use a specific local engine -variant by setting the `FLUTTER_LOCAL_ENGINE` environment variable to the -name of the local engine (e.g. "android_debug_unopt"). If the local engine build -requires a source path, this can be provided by setting the `FLUTTER_LOCAL_ENGINE_SRC_PATH` -environment variable. This second variable is not necessary if the `flutter` and -`engine` checkouts are in adjacent directories. +variant by setting the `FLUTTER_LOCAL_ENGINE` and `FLUTTER_LOCAL_ENGINE_HOST` +environment svariable to the name of the local engines (e.g. `android_debug_unopt` +and `host_debug_unopt`). If the local engine build requires a source path, this +can be provided by setting the `FLUTTER_LOCAL_ENGINE_SRC_PATH` environment +variable. This second variable is not necessary if the `flutter` and `engine` +checkouts are in adjacent directories. ```shell export FLUTTER_LOCAL_ENGINE=android_debug_unopt +export FLUTTER_LOCAL_ENGINE_HOST=host_debug_unopt flutter test test/integration.shard/some_test_case ``` diff --git a/packages/flutter_tools/test/integration.shard/test_utils.dart b/packages/flutter_tools/test/integration.shard/test_utils.dart index 10182820677..b13452209a0 100644 --- a/packages/flutter_tools/test/integration.shard/test_utils.dart +++ b/packages/flutter_tools/test/integration.shard/test_utils.dart @@ -67,6 +67,7 @@ Future getPackages(String folder) async { } const String kLocalEngineEnvironment = 'FLUTTER_LOCAL_ENGINE'; +const String kLocalEngineHostEnvironment = 'FLUTTER_LOCAL_ENGINE_HOST'; const String kLocalEngineLocation = 'FLUTTER_LOCAL_ENGINE_SRC_PATH'; List getLocalEngineArguments() { @@ -75,6 +76,8 @@ List getLocalEngineArguments() { '--local-engine=${platform.environment[kLocalEngineEnvironment]}', if (platform.environment.containsKey(kLocalEngineLocation)) '--local-engine-src-path=${platform.environment[kLocalEngineLocation]}', + if (platform.environment.containsKey(kLocalEngineHostEnvironment)) + '--local-engine-host=${platform.environment[kLocalEngineHostEnvironment]}', ]; }