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`.
This commit is contained in:
Andrew Kolos 2023-09-07 12:38:05 -07:00 committed by GitHub
parent 445e02dd63
commit aea4552acd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -24,6 +24,11 @@ class TestCommand extends Command<void> {
'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<void> {
silent: (argResults!['silent'] as bool?) ?? false,
useEmulator: (argResults!['use-emulator'] as bool?) ?? false,
taskArgs: taskArgs,
exitOnFirstTestFailure: argResults!['exit'] as bool,
);
}
}