From 638331b13328245d7fd5b8cffd729622e3518b8b Mon Sep 17 00:00:00 2001 From: Reid Baker Date: Tue, 12 Nov 2024 16:07:55 -0600 Subject: [PATCH] Update test to include more complete instructions for how to run tests locally, add example to andoid 11 tests as well (#158528) Follow @matanlurey's example and include how to run a test at the top of the test file. --- .../run_android_java11_integration_tool_tests.dart | 14 ++++++++++++++ .../run_flutter_driver_android_tests.dart | 6 ++++-- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/dev/bots/suite_runners/run_android_java11_integration_tool_tests.dart b/dev/bots/suite_runners/run_android_java11_integration_tool_tests.dart index 3ad18cad69..99e1a5b042 100644 --- a/dev/bots/suite_runners/run_android_java11_integration_tool_tests.dart +++ b/dev/bots/suite_runners/run_android_java11_integration_tool_tests.dart @@ -8,6 +8,20 @@ import 'package:path/path.dart' as path; import '../utils.dart'; +/// To run this test locally: +/// +/// 1. Connect an Android device or emulator. +/// 2. Run `dart pub get` in dev/bots +/// 3. Set flutter to use Java 11 +/// flutter config --jdk-dir= +/// On a Mac you can run `/usr/libexec/java_home -V1 to find the installed +/// versions of java. Remember to clear this value after testing. +/// `flutter config --jdk-dir=` +/// 4. Run the following command from the root of the Flutter repository: +/// +/// ```sh +/// SHARD=android_java11_tool_integration_tests bin/cache/dart-sdk/bin/dart dev/bots/test.dart +/// ``` Future androidJava11IntegrationToolTestsRunner() async { final String toolsPath = path.join(flutterRoot, 'packages', 'flutter_tools'); diff --git a/dev/bots/suite_runners/run_flutter_driver_android_tests.dart b/dev/bots/suite_runners/run_flutter_driver_android_tests.dart index e2f97f6e15..7b892e7acc 100644 --- a/dev/bots/suite_runners/run_flutter_driver_android_tests.dart +++ b/dev/bots/suite_runners/run_flutter_driver_android_tests.dart @@ -9,14 +9,16 @@ import '../utils.dart'; /// To run this test locally: /// /// 1. Connect an Android device or emulator. -/// 2. Run the following command from the root of the Flutter repository: +/// 2. Run `dart pub get` in dev/bots +/// 3. Run the following command from the root of the Flutter repository: /// /// ```sh /// SHARD=flutter_driver_android bin/cache/dart-sdk/bin/dart dev/bots/test.dart /// ``` /// -/// For debugging, it is recommended to instead just run and launch these tests +/// For debugging, you need to instead run and launch these tests /// individually _in_ the `dev/integration_tests/native_driver_test` directory. +/// Comparisons against goldens cant happen locally. Future runFlutterDriverAndroidTests() async { print('Running Flutter Driver Android tests...');