Re-enable dds for flutter drive tests that use DevTools (#153129)

Fixes https://github.com/flutter/flutter/issues/153057
This commit is contained in:
Zachary Anderson 2024-08-08 16:50:40 -07:00 committed by GitHub
parent 6c3bb9f307
commit 76107bdf50
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 14 additions and 4 deletions

View File

@ -454,7 +454,11 @@ Future<String> eval(
return output.toString().trimRight();
}
List<String> _flutterCommandArgs(String command, List<String> options) {
List<String> _flutterCommandArgs(
String command,
List<String> options, {
bool driveWithDds = false,
}) {
// Commands support the --device-timeout flag.
final Set<String> supportedDeviceTimeoutCommands = <String>{
'attach',
@ -478,9 +482,9 @@ List<String> _flutterCommandArgs(String command, List<String> options) {
'5',
],
// DDS should be disabled for flutter drive in CI.
// DDS should generally be disabled for flutter drive in CI.
// See https://github.com/flutter/flutter/issues/152684.
if (command == 'drive') '--no-dds',
if (command == 'drive' && !driveWithDds) '--no-dds',
if (command == 'drive' && hostAgent.dumpDirectory != null) ...<String>[
'--screenshot',
@ -505,10 +509,15 @@ List<String> _flutterCommandArgs(String command, List<String> options) {
Future<int> flutter(String command, {
List<String> options = const <String>[],
bool canFail = false, // as in, whether failures are ok. False means that they are fatal.
bool driveWithDds = false, // `flutter drive` tests should generally have dds disabled.
// The exception is tests that also exercise DevTools, such as
// DevToolsMemoryTest in perf_tests.dart.
Map<String, String>? environment,
String? workingDirectory,
}) async {
final List<String> args = _flutterCommandArgs(command, options);
final List<String> args = _flutterCommandArgs(
command, options, driveWithDds: driveWithDds,
);
final int exitCode = await exec(path.join(flutterDirectory.path, 'bin', 'flutter'), args,
canFail: canFail, environment: environment, workingDirectory: workingDirectory);

View File

@ -2172,6 +2172,7 @@ class DevToolsMemoryTest {
await flutter(
'drive',
driveWithDds: true,
options: <String>[
'-d', _device.deviceId,
'--profile',