Audit devicelab log streaming for nullability (#84820)
This commit is contained in:
parent
15301a6f44
commit
03034e9e4a
@ -8,7 +8,6 @@ import 'dart:io';
|
|||||||
|
|
||||||
import 'package:flutter_devicelab/framework/devices.dart';
|
import 'package:flutter_devicelab/framework/devices.dart';
|
||||||
import 'package:flutter_devicelab/framework/framework.dart';
|
import 'package:flutter_devicelab/framework/framework.dart';
|
||||||
import 'package:flutter_devicelab/framework/host_agent.dart';
|
|
||||||
import 'package:flutter_devicelab/framework/task_result.dart';
|
import 'package:flutter_devicelab/framework/task_result.dart';
|
||||||
import 'package:flutter_devicelab/framework/utils.dart';
|
import 'package:flutter_devicelab/framework/utils.dart';
|
||||||
import 'package:path/path.dart' as p;
|
import 'package:path/path.dart' as p;
|
||||||
@ -34,8 +33,6 @@ void main() {
|
|||||||
p.join(complexLayoutPath, 'test_driver', 'semantics_perf.dart'),
|
p.join(complexLayoutPath, 'test_driver', 'semantics_perf.dart'),
|
||||||
'-d',
|
'-d',
|
||||||
deviceId,
|
deviceId,
|
||||||
'--screenshot',
|
|
||||||
hostAgent.dumpDirectory.path,
|
|
||||||
]);
|
]);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -6,7 +6,6 @@
|
|||||||
|
|
||||||
import 'package:flutter_devicelab/framework/devices.dart';
|
import 'package:flutter_devicelab/framework/devices.dart';
|
||||||
import 'package:flutter_devicelab/framework/framework.dart';
|
import 'package:flutter_devicelab/framework/framework.dart';
|
||||||
import 'package:flutter_devicelab/framework/host_agent.dart';
|
|
||||||
import 'package:flutter_devicelab/framework/task_result.dart';
|
import 'package:flutter_devicelab/framework/task_result.dart';
|
||||||
import 'package:flutter_devicelab/framework/utils.dart';
|
import 'package:flutter_devicelab/framework/utils.dart';
|
||||||
|
|
||||||
@ -18,8 +17,6 @@ Future<String> _runWithMode(String mode, String deviceId) async {
|
|||||||
'test_driver/scroll_perf.dart',
|
'test_driver/scroll_perf.dart',
|
||||||
'-d',
|
'-d',
|
||||||
deviceId,
|
deviceId,
|
||||||
'--screenshot',
|
|
||||||
hostAgent.dumpDirectory.path,
|
|
||||||
]);
|
]);
|
||||||
return stderr.toString();
|
return stderr.toString();
|
||||||
}
|
}
|
||||||
|
@ -360,21 +360,24 @@ Future<void> main() async {
|
|||||||
);
|
);
|
||||||
|
|
||||||
if (testResultExit != 0) {
|
if (testResultExit != 0) {
|
||||||
// Zip the test results to the artifacts directory for upload.
|
final Directory dumpDirectory = hostAgent.dumpDirectory;
|
||||||
await inDirectory(resultBundleTemp, () {
|
if (dumpDirectory != null) {
|
||||||
final String zipPath = path.join(hostAgent.dumpDirectory.path,
|
// Zip the test results to the artifacts directory for upload.
|
||||||
'module_test_ios-objc-${DateTime.now().toLocal().toIso8601String()}.zip');
|
await inDirectory(resultBundleTemp, () {
|
||||||
return exec(
|
final String zipPath = path.join(dumpDirectory.path,
|
||||||
'zip',
|
'module_test_ios-objc-${DateTime.now().toLocal().toIso8601String()}.zip');
|
||||||
<String>[
|
return exec(
|
||||||
'-r',
|
'zip',
|
||||||
'-9',
|
<String>[
|
||||||
zipPath,
|
'-r',
|
||||||
'result.xcresult',
|
'-9',
|
||||||
],
|
zipPath,
|
||||||
canFail: true, // Best effort to get the logs.
|
'result.xcresult',
|
||||||
);
|
],
|
||||||
});
|
canFail: true, // Best effort to get the logs.
|
||||||
|
);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
throw TaskResult.failure('Platform unit tests failed');
|
throw TaskResult.failure('Platform unit tests failed');
|
||||||
}
|
}
|
||||||
|
@ -74,20 +74,23 @@ Future<void> main() async {
|
|||||||
);
|
);
|
||||||
|
|
||||||
if (testResultExit != 0) {
|
if (testResultExit != 0) {
|
||||||
// Zip the test results to the artifacts directory for upload.
|
final Directory dumpDirectory = hostAgent.dumpDirectory;
|
||||||
final String zipPath = path.join(hostAgent.dumpDirectory.path,
|
if (dumpDirectory != null) {
|
||||||
'native_ui_tests_ios32-${DateTime.now().toLocal().toIso8601String()}.zip');
|
// Zip the test results to the artifacts directory for upload.
|
||||||
await exec(
|
final String zipPath = path.join(dumpDirectory.path,
|
||||||
'zip',
|
'native_ui_tests_ios32-${DateTime.now().toLocal().toIso8601String()}.zip');
|
||||||
<String>[
|
await exec(
|
||||||
'-r',
|
'zip',
|
||||||
'-9',
|
<String>[
|
||||||
zipPath,
|
'-r',
|
||||||
'result.xcresult',
|
'-9',
|
||||||
],
|
zipPath,
|
||||||
workingDirectory: resultBundleTemp,
|
'result.xcresult',
|
||||||
canFail: true, // Best effort to get the logs.
|
],
|
||||||
);
|
workingDirectory: resultBundleTemp,
|
||||||
|
canFail: true, // Best effort to get the logs.
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
return TaskResult.failure('Platform unit tests failed');
|
return TaskResult.failure('Platform unit tests failed');
|
||||||
}
|
}
|
||||||
|
@ -11,7 +11,6 @@ import 'dart:io';
|
|||||||
import 'package:flutter_devicelab/common.dart';
|
import 'package:flutter_devicelab/common.dart';
|
||||||
import 'package:flutter_devicelab/framework/devices.dart';
|
import 'package:flutter_devicelab/framework/devices.dart';
|
||||||
import 'package:flutter_devicelab/framework/framework.dart';
|
import 'package:flutter_devicelab/framework/framework.dart';
|
||||||
import 'package:flutter_devicelab/framework/host_agent.dart';
|
|
||||||
import 'package:flutter_devicelab/framework/task_result.dart';
|
import 'package:flutter_devicelab/framework/task_result.dart';
|
||||||
import 'package:flutter_devicelab/framework/utils.dart';
|
import 'package:flutter_devicelab/framework/utils.dart';
|
||||||
import 'package:path/path.dart' as path;
|
import 'package:path/path.dart' as path;
|
||||||
@ -31,8 +30,6 @@ void main() {
|
|||||||
'--verbose',
|
'--verbose',
|
||||||
'-d',
|
'-d',
|
||||||
device.deviceId,
|
device.deviceId,
|
||||||
'--screenshot',
|
|
||||||
hostAgent.dumpDirectory.path,
|
|
||||||
'--route',
|
'--route',
|
||||||
'/smuggle-it',
|
'/smuggle-it',
|
||||||
'lib/route.dart',
|
'lib/route.dart',
|
||||||
|
@ -615,10 +615,11 @@ class AndroidDevice extends Device {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Future<void> stopLoggingToSink() async {
|
Future<void> stopLoggingToSink() async {
|
||||||
assert(_loggingProcess != null);
|
if (_loggingProcess != null) {
|
||||||
_abortedLogging = true;
|
_abortedLogging = true;
|
||||||
_loggingProcess.kill();
|
_loggingProcess.kill();
|
||||||
await _loggingProcess.exitCode;
|
await _loggingProcess.exitCode;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@ -877,10 +878,11 @@ class IosDevice extends Device {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Future<void> stopLoggingToSink() async {
|
Future<void> stopLoggingToSink() async {
|
||||||
assert(_loggingProcess != null);
|
if (_loggingProcess != null) {
|
||||||
_abortedLogging = true;
|
_abortedLogging = true;
|
||||||
_loggingProcess.kill();
|
_loggingProcess.kill();
|
||||||
await _loggingProcess.exitCode;
|
await _loggingProcess.exitCode;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// The methods below are stubs for now. They will need to be expanded.
|
// The methods below are stubs for now. They will need to be expanded.
|
||||||
|
@ -161,9 +161,8 @@ class _TaskRunner {
|
|||||||
result = await futureResult;
|
result = await futureResult;
|
||||||
} finally {
|
} finally {
|
||||||
if (device != null && device.canStreamLogs) {
|
if (device != null && device.canStreamLogs) {
|
||||||
assert(sink != null);
|
|
||||||
await device.stopLoggingToSink();
|
await device.stopLoggingToSink();
|
||||||
await sink.close();
|
await sink?.close();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -16,6 +16,7 @@ import 'package:path/path.dart' as path;
|
|||||||
import 'package:process/process.dart';
|
import 'package:process/process.dart';
|
||||||
import 'package:stack_trace/stack_trace.dart';
|
import 'package:stack_trace/stack_trace.dart';
|
||||||
|
|
||||||
|
import 'host_agent.dart';
|
||||||
import 'task_result.dart';
|
import 'task_result.dart';
|
||||||
|
|
||||||
/// Virtual current working directory, which affect functions, such as [exec].
|
/// Virtual current working directory, which affect functions, such as [exec].
|
||||||
@ -453,6 +454,11 @@ List<String> flutterCommandArgs(String command, List<String> options) {
|
|||||||
'--device-timeout',
|
'--device-timeout',
|
||||||
'5',
|
'5',
|
||||||
],
|
],
|
||||||
|
|
||||||
|
if (command == 'drive' && hostAgent.dumpDirectory != null) ...<String>[
|
||||||
|
'--screenshot',
|
||||||
|
hostAgent.dumpDirectory.path,
|
||||||
|
],
|
||||||
if (localEngine != null) ...<String>['--local-engine', localEngine],
|
if (localEngine != null) ...<String>['--local-engine', localEngine],
|
||||||
if (localEngineSrcPath != null) ...<String>['--local-engine-src-path', localEngineSrcPath],
|
if (localEngineSrcPath != null) ...<String>['--local-engine-src-path', localEngineSrcPath],
|
||||||
...options,
|
...options,
|
||||||
|
@ -10,7 +10,6 @@ import 'dart:math' as math;
|
|||||||
|
|
||||||
import '../framework/devices.dart';
|
import '../framework/devices.dart';
|
||||||
import '../framework/framework.dart';
|
import '../framework/framework.dart';
|
||||||
import '../framework/host_agent.dart';
|
|
||||||
import '../framework/task_result.dart';
|
import '../framework/task_result.dart';
|
||||||
import '../framework/utils.dart';
|
import '../framework/utils.dart';
|
||||||
|
|
||||||
@ -104,8 +103,6 @@ class GalleryTransitionTest {
|
|||||||
'test_driver/$testDriver.dart',
|
'test_driver/$testDriver.dart',
|
||||||
'-d',
|
'-d',
|
||||||
deviceId,
|
deviceId,
|
||||||
'--screenshot',
|
|
||||||
hostAgent.dumpDirectory.path,
|
|
||||||
]);
|
]);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -6,7 +6,6 @@
|
|||||||
|
|
||||||
import '../framework/devices.dart';
|
import '../framework/devices.dart';
|
||||||
import '../framework/framework.dart';
|
import '../framework/framework.dart';
|
||||||
import '../framework/host_agent.dart';
|
|
||||||
import '../framework/task_result.dart';
|
import '../framework/task_result.dart';
|
||||||
import '../framework/utils.dart';
|
import '../framework/utils.dart';
|
||||||
|
|
||||||
@ -161,8 +160,6 @@ class DriverTest {
|
|||||||
testTarget,
|
testTarget,
|
||||||
'-d',
|
'-d',
|
||||||
deviceId,
|
deviceId,
|
||||||
'--screenshot',
|
|
||||||
hostAgent.dumpDirectory.path,
|
|
||||||
...extraOptions,
|
...extraOptions,
|
||||||
];
|
];
|
||||||
await flutter('drive', options: options, environment: Map<String, String>.from(environment));
|
await flutter('drive', options: options, environment: Map<String, String>.from(environment));
|
||||||
|
@ -314,8 +314,6 @@ TaskFunction createStackSizeTest() {
|
|||||||
'--driver', testDriver,
|
'--driver', testDriver,
|
||||||
'-d',
|
'-d',
|
||||||
deviceId,
|
deviceId,
|
||||||
'--screenshot',
|
|
||||||
hostAgent.dumpDirectory.path,
|
|
||||||
]);
|
]);
|
||||||
final Map<String, dynamic> data = json.decode(
|
final Map<String, dynamic> data = json.decode(
|
||||||
file('${_testOutputDirectory(testDirectory)}/stack_size.json').readAsStringSync(),
|
file('${_testOutputDirectory(testDirectory)}/stack_size.json').readAsStringSync(),
|
||||||
@ -411,8 +409,6 @@ TaskFunction createsScrollSmoothnessPerfTest() {
|
|||||||
'-t', testTarget,
|
'-t', testTarget,
|
||||||
'-d',
|
'-d',
|
||||||
deviceId,
|
deviceId,
|
||||||
'--screenshot',
|
|
||||||
hostAgent.dumpDirectory.path,
|
|
||||||
]);
|
]);
|
||||||
final Map<String, dynamic> data = json.decode(
|
final Map<String, dynamic> data = json.decode(
|
||||||
file('${_testOutputDirectory(testDirectory)}/scroll_smoothness_test.json').readAsStringSync(),
|
file('${_testOutputDirectory(testDirectory)}/scroll_smoothness_test.json').readAsStringSync(),
|
||||||
@ -464,8 +460,6 @@ TaskFunction createFramePolicyIntegrationTest() {
|
|||||||
'-t', testTarget,
|
'-t', testTarget,
|
||||||
'-d',
|
'-d',
|
||||||
deviceId,
|
deviceId,
|
||||||
'--screenshot',
|
|
||||||
hostAgent.dumpDirectory.path,
|
|
||||||
]);
|
]);
|
||||||
final Map<String, dynamic> data = json.decode(
|
final Map<String, dynamic> data = json.decode(
|
||||||
file('${_testOutputDirectory(testDirectory)}/frame_policy_event_delay.json').readAsStringSync(),
|
file('${_testOutputDirectory(testDirectory)}/frame_policy_event_delay.json').readAsStringSync(),
|
||||||
@ -585,16 +579,20 @@ class StartupTest {
|
|||||||
results.add(data);
|
results.add(data);
|
||||||
} else {
|
} else {
|
||||||
currentFailures += 1;
|
currentFailures += 1;
|
||||||
await flutter(
|
if (hostAgent.dumpDirectory != null) {
|
||||||
'screenshot',
|
await flutter(
|
||||||
options: <String>[
|
'screenshot',
|
||||||
'-d',
|
options: <String>[
|
||||||
device.deviceId,
|
'-d',
|
||||||
'--out',
|
device.deviceId,
|
||||||
hostAgent.dumpDirectory.childFile('screenshot_startup_failure_$currentFailures.png').path,
|
'--out',
|
||||||
],
|
hostAgent.dumpDirectory
|
||||||
canFail: true,
|
.childFile('screenshot_startup_failure_$currentFailures.png')
|
||||||
);
|
.path,
|
||||||
|
],
|
||||||
|
canFail: true,
|
||||||
|
);
|
||||||
|
}
|
||||||
i -= 1;
|
i -= 1;
|
||||||
if (currentFailures == maxFailures) {
|
if (currentFailures == maxFailures) {
|
||||||
return TaskResult.failure('Application failed to start $maxFailures times');
|
return TaskResult.failure('Application failed to start $maxFailures times');
|
||||||
@ -830,8 +828,6 @@ class PerfTest {
|
|||||||
...<String>['--dart-define', dartDefine],
|
...<String>['--dart-define', dartDefine],
|
||||||
'-d',
|
'-d',
|
||||||
deviceId,
|
deviceId,
|
||||||
'--screenshot',
|
|
||||||
hostAgent.dumpDirectory.path,
|
|
||||||
]);
|
]);
|
||||||
final Map<String, dynamic> data = json.decode(
|
final Map<String, dynamic> data = json.decode(
|
||||||
file('${_testOutputDirectory(testDirectory)}/$resultFilename.json').readAsStringSync(),
|
file('${_testOutputDirectory(testDirectory)}/$resultFilename.json').readAsStringSync(),
|
||||||
@ -1461,8 +1457,6 @@ class DevToolsMemoryTest {
|
|||||||
'drive',
|
'drive',
|
||||||
options: <String>[
|
options: <String>[
|
||||||
'-d', _device.deviceId,
|
'-d', _device.deviceId,
|
||||||
'--screenshot',
|
|
||||||
hostAgent.dumpDirectory.path,
|
|
||||||
'--profile',
|
'--profile',
|
||||||
'--profile-memory', _kJsonFileName,
|
'--profile-memory', _kJsonFileName,
|
||||||
'--no-publish-port',
|
'--no-publish-port',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user