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

This reverts commit a90880a8c3.
This commit is contained in:
Jonah Williams
2020-11-10 05:21:14 -08:00
committed by GitHub
parent a90880a8c3
commit 84a8bd3f5a
2 changed files with 10 additions and 3 deletions

View File

@@ -235,9 +235,16 @@ class FlutterDriverService extends DriverService {
int driverPort,
List<String> browserDimension,
}) 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>[
_dartSdkPath,
...<String>[...arguments, testFile, '-rexpanded'],
if (packageConfig['test'] != null)
...<String>['pub', 'run', 'test', ...arguments, testFile, '-rexpanded']
else
...<String>[...arguments, testFile, '-rexpanded'],
], environment: <String, String>{
'VM_SERVICE_URL': _vmServiceUri,
...environment,