From c89d563944e31eff9b3ec8b849859f925bebe2d1 Mon Sep 17 00:00:00 2001 From: Harri Kirik Date: Mon, 10 Feb 2025 18:39:49 +0200 Subject: [PATCH] Add additional information to DeviceLab readme for running DeviceLab tests locally (#160243) Fixes https://github.com/flutter/flutter/issues/160242 ## Pre-launch Checklist - [x] I read the [Contributor Guide] and followed the process outlined there for submitting PRs. - [x] I read the [Tree Hygiene] wiki page, which explains my responsibilities. - [x] I read and followed the [Flutter Style Guide], including [Features we expect every widget to implement]. - [x] I signed the [CLA]. - [x] I listed at least one issue that this PR fixes in the description above. - [x] I updated/added relevant documentation (doc comments with `///`). - [x] I added new tests to check the change I am making, or this PR is [test-exempt]. - [x] I followed the [breaking change policy] and added [Data Driven Fixes] where supported. - [x] All existing and new tests are passing. If you need help, consider asking for advice on the #hackers-new channel on [Discord]. --- dev/devicelab/README.md | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/dev/devicelab/README.md b/dev/devicelab/README.md index 92e01c3bd8..fdd725c62e 100644 --- a/dev/devicelab/README.md +++ b/dev/devicelab/README.md @@ -56,9 +56,12 @@ You can find where your Android SDK is using `flutter doctor -v`. ### Warnings -Running the devicelab will do things to your environment. +Running DeviceLab tests locally will do things to your environment. -Notably, it will start and stop Gradle, for instance. +Notably: + +- It will automatically start and stop Gradle on your machine +- It will automatically reboot your target Android or iOS device after a certain amount of tests before running any additional tests on it. See the `checkForRebootRequired()` in `flutter/dev/devicelab/lib/framework/framework.dart` and `device.reboot()` in `flutter/dev/devicelab/lib/framework/devices.dart` for more. ### Running tests in `test/...` @@ -82,6 +85,14 @@ To run multiple tests, repeat option `-t` (`--task`) multiple times: ../../bin/cache/dart-sdk/bin/dart bin/run.dart -t test1 -t test2 -t test3 ``` +### Running tests without automatic retries + +By default, DeviceLab tests have an automatic retry logic built in. Any failing tests will be retried 2 additional times. This can be skipped by specifying the `--exit` option: + +```sh +../../bin/cache/dart-sdk/bin/dart bin/test_runner.dart test --exit -t {NAME_OF_TEST} +``` + ### Running tests against a local engine build To run device lab tests against a local engine build, pass the appropriate