[flutter_tools] measure driver success and failure (#69226)

Currently we only have a test that measures if flutter drive can fail. Unfortunately it has been failing for multiple years based on the fact that the error is due to a missing Gradle config.

Add a smoke success test case, and update both tests to use the test API and the tester-device.
This commit is contained in:
Jonah Williams
2020-10-28 18:15:23 -07:00
committed by GitHub
parent 69d7637796
commit 7629758ed7
8 changed files with 85 additions and 12 deletions

View File

@@ -239,15 +239,23 @@ Future<void> _runSmokeTests() async {
expectFailure: true,
printOutput: false,
),
runCommand(flutter,
<String>['drive', '--use-existing-app', '-t', path.join('test_driver', 'failure.dart')],
workingDirectory: path.join(flutterRoot, 'packages', 'flutter_driver'),
expectNonZeroExit: true,
outputMode: OutputMode.capture,
),
],
);
// The flutter-tester device cannot be run concurrently in the same project directory.
await runCommand(flutter,
<String>['drive', '--show-test-device', '-d', 'flutter-tester', '-t', path.join('test_driver', 'success.dart')],
workingDirectory: path.join(flutterRoot, 'packages', 'flutter_driver'),
expectNonZeroExit: false,
outputMode: OutputMode.capture,
);
await runCommand(flutter,
<String>['drive', '--show-test-device', '-d', 'flutter-tester', '-t', path.join('test_driver', 'failure.dart')],
workingDirectory: path.join(flutterRoot, 'packages', 'flutter_driver'),
expectNonZeroExit: true,
outputMode: OutputMode.capture,
);
// Verify that we correctly generated the version file.
final String versionError = await verifyVersion(File(path.join(flutterRoot, 'version')));
if (versionError != null)