From aea4552acdc72393a4e51780dd318d9e32978c1f Mon Sep 17 00:00:00 2001 From: Andrew Kolos Date: Thu, 7 Sep 2023 12:38:05 -0700 Subject: [PATCH] add --exit flag to dev/devicelab/bin/test_runner.dart (#134165) Resolves #134070 Adds a flag to the `test_runner.dart test` script that will cause the test runner to exit upon first failure (or, said another way, exit without retrying). This is in parity with the `--exit` flag of `dev/devicelab/bin/run.dart`. --- dev/devicelab/lib/command/test.dart | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/dev/devicelab/lib/command/test.dart b/dev/devicelab/lib/command/test.dart index e656c8bad1e7..c65a5da287d6 100644 --- a/dev/devicelab/lib/command/test.dart +++ b/dev/devicelab/lib/command/test.dart @@ -24,6 +24,11 @@ class TestCommand extends Command { 'settings in the test case, and will results in error if no device\n' 'with given ID/ID prefix is found.', ); + argParser.addFlag( + 'exit', + help: 'Exit on the first test failure. Currently flakes are intentionally (though ' + 'incorrectly) not considered to be failures.', + ); argParser.addOption( 'git-branch', help: '[Flutter infrastructure] Git branch of the current commit. LUCI\n' @@ -90,6 +95,7 @@ class TestCommand extends Command { silent: (argResults!['silent'] as bool?) ?? false, useEmulator: (argResults!['use-emulator'] as bool?) ?? false, taskArgs: taskArgs, + exitOnFirstTestFailure: argResults!['exit'] as bool, ); } }