Skip to content

Commit 40d9fcf

Browse files
authored
Document that flutter drive --test-arguments can opt-in to dart test (#152410)
Closes flutter/flutter#51135. Closes flutter/flutter#145499. Making this the _default_, or better discoverable, is tracked in flutter/flutter#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 flutter/flutter#51135 & flutter/flutter#145499 that seems unlikely.
1 parent 4d40e7e commit 40d9fcf

File tree

4 files changed

+15
-9
lines changed

4 files changed

+15
-9
lines changed

packages/flutter_tools/lib/src/commands/drive.dart

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

packages/flutter_tools/lib/src/drive/drive_service.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,8 @@ class FlutterDriverService extends DriverService {
262262
try {
263263
final int result = await _processUtils.stream(<String>[
264264
_dartSdkPath,
265-
...<String>[...arguments, testFile, '-rexpanded'],
265+
...arguments,
266+
testFile,
266267
], environment: <String, String>{
267268
'VM_SERVICE_URL': _vmServiceUri,
268269
...environment,

packages/flutter_tools/lib/src/drive/web_driver_service.dart

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,6 @@ class WebDriverService extends DriverService {
195195
_dartSdkPath,
196196
...arguments,
197197
testFile,
198-
'-rexpanded',
199198
], environment: <String, String>{
200199
'VM_SERVICE_URL': _webUri.toString(),
201200
..._additionalDriverEnvironment(webDriver, browserName, androidEmulator),

packages/flutter_tools/test/general.shard/drive/drive_service_test.dart

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ void main() {
104104
]);
105105
final FakeProcessManager processManager = FakeProcessManager.list(<FakeCommand>[
106106
const FakeCommand(
107-
command: <String>['dart', '--enable-experiment=non-nullable', 'foo.test', '-rexpanded'],
107+
command: <String>['dart', '--enable-experiment=non-nullable', 'foo.test'],
108108
exitCode: 23,
109109
environment: <String, String>{
110110
'FOO': 'BAR',
@@ -129,7 +129,7 @@ void main() {
129129
]);
130130
final FakeProcessManager processManager = FakeProcessManager.list(<FakeCommand>[
131131
const FakeCommand(
132-
command: <String>['dart', '--enable-experiment=non-nullable', 'foo.test', '-rexpanded'],
132+
command: <String>['dart', '--enable-experiment=non-nullable', 'foo.test'],
133133
exitCode: 23,
134134
environment: <String, String>{
135135
'FOO': 'BAR',
@@ -159,7 +159,7 @@ void main() {
159159
]);
160160
final FakeProcessManager processManager = FakeProcessManager.list(<FakeCommand>[
161161
const FakeCommand(
162-
command: <String>['dart', '--enable-experiment=non-nullable', 'foo.test', '-rexpanded'],
162+
command: <String>['dart', '--enable-experiment=non-nullable', 'foo.test'],
163163
exitCode: 23,
164164
environment: <String, String>{
165165
'FOO': 'BAR',
@@ -192,7 +192,7 @@ void main() {
192192
]);
193193
final FakeProcessManager processManager = FakeProcessManager.list(<FakeCommand>[
194194
const FakeCommand(
195-
command: <String>['dart', '--enable-experiment=non-nullable', 'foo.test', '-rexpanded'],
195+
command: <String>['dart', '--enable-experiment=non-nullable', 'foo.test'],
196196
exitCode: 23,
197197
environment: <String, String>{
198198
'FOO': 'BAR',
@@ -223,7 +223,7 @@ void main() {
223223
]);
224224
final FakeProcessManager processManager = FakeProcessManager.list(<FakeCommand>[
225225
const FakeCommand(
226-
command: <String>['dart', 'foo.test', '-rexpanded'],
226+
command: <String>['dart', 'foo.test'],
227227
exitCode: 11,
228228
environment: <String, String>{
229229
'VM_SERVICE_URL': 'http://127.0.0.1:63426/1UasC_ihpXY=/',

0 commit comments

Comments
 (0)