Unverified Commit a90880a8 authored by Jonah Williams's avatar Jonah Williams Committed by GitHub

[flutter_tools] always use dart to run test script. (#70146)

parent 900da21f
...@@ -235,16 +235,9 @@ class FlutterDriverService extends DriverService { ...@@ -235,16 +235,9 @@ class FlutterDriverService extends DriverService {
int driverPort, int driverPort,
List<String> browserDimension, List<String> browserDimension,
}) async { }) async {
// Check if package:test is available. If not, fall back to invoking
// the test script directly. `pub run test` is strictly better because
// in the even that a socket or something similar is left open, the
// test runner will correctly shutdown the VM instead of hanging forever.
return _processUtils.stream(<String>[ return _processUtils.stream(<String>[
_dartSdkPath, _dartSdkPath,
if (packageConfig['test'] != null) ...<String>[...arguments, testFile, '-rexpanded'],
...<String>['pub', 'run', 'test', ...arguments, testFile, '-rexpanded']
else
...<String>[...arguments, testFile, '-rexpanded'],
], environment: <String, String>{ ], environment: <String, String>{
'VM_SERVICE_URL': _vmServiceUri, 'VM_SERVICE_URL': _vmServiceUri,
...environment, ...environment,
......
...@@ -151,7 +151,7 @@ void main() { ...@@ -151,7 +151,7 @@ void main() {
]); ]);
final FakeProcessManager processManager = FakeProcessManager.list(<FakeCommand>[ final FakeProcessManager processManager = FakeProcessManager.list(<FakeCommand>[
const FakeCommand( const FakeCommand(
command: <String>['dart', 'pub', 'run', 'test', '--enable-experiment=non-nullable', 'foo.test', '-rexpanded'], command: <String>['dart', '--enable-experiment=non-nullable', 'foo.test', '-rexpanded'],
exitCode: 23, exitCode: 23,
environment: <String, String>{ environment: <String, String>{
'FOO': 'BAR', 'FOO': 'BAR',
...@@ -212,7 +212,7 @@ void main() { ...@@ -212,7 +212,7 @@ void main() {
]); ]);
final FakeProcessManager processManager = FakeProcessManager.list(<FakeCommand>[ final FakeProcessManager processManager = FakeProcessManager.list(<FakeCommand>[
const FakeCommand( const FakeCommand(
command: <String>['dart', 'pub', 'run', 'test', 'foo.test', '-rexpanded'], command: <String>['dart', 'foo.test', '-rexpanded'],
exitCode: 11, exitCode: 11,
environment: <String, String>{ environment: <String, String>{
'VM_SERVICE_URL': 'http://127.0.0.1:1234/' 'VM_SERVICE_URL': 'http://127.0.0.1:1234/'
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment