Document that flutter drive --test-arguments can opt-in to dart test (#152410)

Closes https://github.com/flutter/flutter/issues/51135.
Closes https://github.com/flutter/flutter/issues/145499.

Making this the _default_, or better discoverable, is tracked in
https://github.com/flutter/flutter/issues/152409.

You'll notice I also removed `-rexpanded`; @jonahwilliams believes that
was accidentally copied over from else-where, and never did anything
(someone I guess could have parsed it in `void main(...)`, but given
https://github.com/flutter/flutter/issues/51135 &
https://github.com/flutter/flutter/issues/145499 that seems unlikely.
This commit is contained in:
Matan Lurey 2024-07-26 18:25:58 -07:00 committed by GitHub
parent 4d40e7e5d5
commit 40d9fcf767
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 15 additions and 9 deletions

View File

@ -136,8 +136,14 @@ class DriveCommand extends RunCommandBase {
..addOption('write-sksl-on-exit',
help: 'Attempts to write an SkSL file when the drive process is finished '
'to the provided file, overwriting it if necessary.')
..addMultiOption('test-arguments', help: 'Additional arguments to pass to the '
'Dart VM running The test script.')
..addMultiOption(
'test-arguments',
help: 'Additional arguments to pass to the Dart VM running The test script.\n\n'
'This can be used to opt-in to use "dart test" as a runner for the test script, '
'which allows, among other things, changing the reporter. For example, to opt-in '
'to the "expanded" reporter, pass both "test" and "--reporter=expanded".\n\n'
'Please leave feedback at <https://github.com/flutter/flutter/issues/152409>.',
)
..addOption('profile-memory', help: 'Launch devtools and profile application memory, writing '
'The output data to the file path provided to this argument as JSON.',
valueHelp: 'profile_memory.json')

View File

@ -262,7 +262,8 @@ class FlutterDriverService extends DriverService {
try {
final int result = await _processUtils.stream(<String>[
_dartSdkPath,
...<String>[...arguments, testFile, '-rexpanded'],
...arguments,
testFile,
], environment: <String, String>{
'VM_SERVICE_URL': _vmServiceUri,
...environment,

View File

@ -195,7 +195,6 @@ class WebDriverService extends DriverService {
_dartSdkPath,
...arguments,
testFile,
'-rexpanded',
], environment: <String, String>{
'VM_SERVICE_URL': _webUri.toString(),
..._additionalDriverEnvironment(webDriver, browserName, androidEmulator),

View File

@ -104,7 +104,7 @@ void main() {
]);
final FakeProcessManager processManager = FakeProcessManager.list(<FakeCommand>[
const FakeCommand(
command: <String>['dart', '--enable-experiment=non-nullable', 'foo.test', '-rexpanded'],
command: <String>['dart', '--enable-experiment=non-nullable', 'foo.test'],
exitCode: 23,
environment: <String, String>{
'FOO': 'BAR',
@ -129,7 +129,7 @@ void main() {
]);
final FakeProcessManager processManager = FakeProcessManager.list(<FakeCommand>[
const FakeCommand(
command: <String>['dart', '--enable-experiment=non-nullable', 'foo.test', '-rexpanded'],
command: <String>['dart', '--enable-experiment=non-nullable', 'foo.test'],
exitCode: 23,
environment: <String, String>{
'FOO': 'BAR',
@ -159,7 +159,7 @@ void main() {
]);
final FakeProcessManager processManager = FakeProcessManager.list(<FakeCommand>[
const FakeCommand(
command: <String>['dart', '--enable-experiment=non-nullable', 'foo.test', '-rexpanded'],
command: <String>['dart', '--enable-experiment=non-nullable', 'foo.test'],
exitCode: 23,
environment: <String, String>{
'FOO': 'BAR',
@ -192,7 +192,7 @@ void main() {
]);
final FakeProcessManager processManager = FakeProcessManager.list(<FakeCommand>[
const FakeCommand(
command: <String>['dart', '--enable-experiment=non-nullable', 'foo.test', '-rexpanded'],
command: <String>['dart', '--enable-experiment=non-nullable', 'foo.test'],
exitCode: 23,
environment: <String, String>{
'FOO': 'BAR',
@ -223,7 +223,7 @@ void main() {
]);
final FakeProcessManager processManager = FakeProcessManager.list(<FakeCommand>[
const FakeCommand(
command: <String>['dart', 'foo.test', '-rexpanded'],
command: <String>['dart', 'foo.test'],
exitCode: 11,
environment: <String, String>{
'VM_SERVICE_URL': 'http://127.0.0.1:63426/1UasC_ihpXY=/',