Unverified Commit 2c12a8d9 authored by Jonah Williams's avatar Jonah Williams Committed by GitHub

[devicelab] remove twc enabled test and uncaught image test (#68518)

parent 720dff6a
// Copyright 2014 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'package:flutter_devicelab/framework/adb.dart';
import 'package:flutter_devicelab/framework/framework.dart';
import 'package:flutter_devicelab/tasks/track_widget_creation_enabled_task.dart';
/// Verify that twc can be enabled/disabled on Android
Future<void> main() async {
deviceOperatingSystem = DeviceOperatingSystem.android;
await task(TrackWidgetCreationEnabledTask().task);
}
// Copyright 2014 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'package:flutter_devicelab/framework/adb.dart';
import 'package:flutter_devicelab/framework/framework.dart';
import 'package:flutter_devicelab/tasks/track_widget_creation_enabled_task.dart';
/// Verify that twc can be enabled/disabled on iOS
Future<void> main() async {
deviceOperatingSystem = DeviceOperatingSystem.ios;
await task(TrackWidgetCreationEnabledTask().task);
}
// Copyright 2014 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'dart:convert';
import 'dart:io';
import 'package:flutter_devicelab/framework/adb.dart';
import 'package:flutter_devicelab/framework/framework.dart';
import 'package:flutter_devicelab/framework/task_result.dart';
import 'package:flutter_devicelab/framework/utils.dart';
import 'package:path/path.dart' as path;
Future<void> main() async {
deviceOperatingSystem = DeviceOperatingSystem.android;
await task(() async {
return inDirectory<TaskResult>('${flutterDirectory.path}/dev/integration_tests/image_loading', () async {
final Device device = await devices.workingDevice;
await device.unlock();
final String deviceId = device.deviceId;
await flutter('packages', options: <String>['get']);
bool passed = false;
final List<String> options = <String>[
'-v',
'-t',
'lib/main.dart',
'-d',
'--no-pub',
'--no-android-gradle-daemon',
deviceId,
];
final Process process = await startProcess(
path.join(flutterDirectory.path, 'bin', 'flutter'),
<String>['run', ...options],
);
final Stream<String> lines = process.stdout
.transform(utf8.decoder)
.transform(const LineSplitter());
process.stderr.listen(print);
await for (final String line in lines) {
print(line);
if (line.contains('ERROR caught by framework')) {
passed = true;
break;
}
if (line.contains('EXCEPTION CAUGHT BY FLUTTER FRAMEWORK ')) {
passed = false;
break;
}
}
if (passed) {
return TaskResult.success(null);
} else {
return TaskResult.failure('Failed to catch sync error in image loading.');
}
});
});
}
// Copyright 2014 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'package:flutter_devicelab/framework/framework.dart';
import 'package:flutter_devicelab/tasks/track_widget_creation_enabled_task.dart';
/// Verify that twc can be enabled/disabled on the web.
Future<void> main() async {
await task(TrackWidgetCreationEnabledTask('chrome', <String>['--web-run-headless']).task);
}
......@@ -14,7 +14,6 @@ import 'package:flutter_devicelab/framework/adb.dart';
import 'package:flutter_devicelab/framework/framework.dart';
import 'package:flutter_devicelab/framework/task_result.dart';
import 'package:flutter_devicelab/framework/utils.dart';
import 'package:flutter_devicelab/tasks/track_widget_creation_enabled_task.dart';
TaskFunction createComplexLayoutScrollPerfTest({bool measureCpuGpu = true}) {
return PerfTest(
......@@ -1462,6 +1461,19 @@ class _UnzipListEntry {
final String path;
}
/// Wait for up to 400 seconds for the file to appear.
Future<File> waitForFile(String path) async {
for (int i = 0; i < 20; i += 1) {
final File file = File(path);
print('looking for ${file.path}');
if (file.existsSync()) {
return file;
}
await Future<void>.delayed(const Duration(seconds: 20));
}
throw StateError('Did not find vmservice out file after 400 seconds');
}
String _findIosAppInBuildDirectory(String searchDirectory) {
for (final FileSystemEntity entity in Directory(searchDirectory).listSync()) {
if (entity.path.endsWith('.app')) {
......
// Copyright 2014 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'dart:convert';
import 'dart:io';
import 'package:vm_service/vm_service.dart';
import 'package:vm_service/vm_service_io.dart';
import 'package:flutter_devicelab/framework/adb.dart';
import 'package:path/path.dart' as path;
import 'package:flutter_devicelab/framework/task_result.dart';
import 'package:flutter_devicelab/framework/utils.dart';
final Directory integrationTestDir = Directory(
path.join(flutterDirectory.path, 'dev/integration_tests/ui'),
);
/// Verifies that track-widget-creation can be enabled and disabled.
class TrackWidgetCreationEnabledTask {
TrackWidgetCreationEnabledTask([
this.deviceIdOverride,
this.additionalArgs = const <String>[],
]);
String deviceIdOverride;
final List<String> additionalArgs;
Future<TaskResult> task() async {
final File file = File(path.join(integrationTestDir.path, 'info'));
if (file.existsSync()) {
file.deleteSync();
}
bool failed = false;
String message = '';
if (deviceIdOverride == null) {
final Device device = await devices.workingDevice;
await device.unlock();
deviceIdOverride = device.deviceId;
}
await inDirectory<void>(integrationTestDir, () async {
section('Running with track-widget-creation enabled');
final Process runProcess = await startProcess(
path.join(flutterDirectory.path, 'bin', 'flutter'),
flutterCommandArgs('run', <String>[
'--no-android-gradle-daemon',
...?additionalArgs,
'--vmservice-out-file=info',
'--track-widget-creation',
'-v',
'-d',
deviceIdOverride,
path.join('lib/track_widget_creation.dart'),
]),
);
runProcess.stdout
.transform(utf8.decoder)
.transform(const LineSplitter())
.listen(print);
final File file = await waitForFile(path.join(integrationTestDir.path, 'info'));
final VmService vmService = await vmServiceConnectUri(file.readAsStringSync());
final VM vm = await vmService.getVM();
final Response result = await vmService.callMethod(
'ext.devicelab.test',
isolateId: vm.isolates.single.id,
);
if (result.json['result'] != 2) {
message += result.json.toString();
failed = true;
}
runProcess.stdin.write('q');
vmService.dispose();
file.deleteSync();
await runProcess.exitCode;
});
await inDirectory<void>(integrationTestDir, () async {
section('Running with track-widget-creation disabled');
final Process runProcess = await startProcess(
path.join(flutterDirectory.path, 'bin', 'flutter'),
flutterCommandArgs('run', <String>[
'--no-android-gradle-daemon',
...?additionalArgs,
'--vmservice-out-file=info',
'--no-track-widget-creation',
'-v',
'-d',
deviceIdOverride,
path.join('lib/track_widget_creation.dart'),
]),
);
runProcess.stdout
.transform(utf8.decoder)
.transform(const LineSplitter())
.listen(print);
final File file = await waitForFile(path.join(integrationTestDir.path, 'info'));
final VmService vmService = await vmServiceConnectUri(file.readAsStringSync());
final VM vm = await vmService.getVM();
final Response result = await vmService.callMethod(
'ext.devicelab.test',
isolateId: vm.isolates.single.id,
);
if (result.json['result'] != 1) {
message += result.json.toString();
failed = true;
}
runProcess.stdin.write('q');
vmService.dispose();
file.deleteSync();
await runProcess.exitCode;
});
return failed
? TaskResult.failure(message)
: TaskResult.success(null);
}
}
/// Wait for up to 400 seconds for the file to appear.
Future<File> waitForFile(String path) async {
for (int i = 0; i < 20; i += 1) {
final File file = File(path);
print('looking for ${file.path}');
if (file.existsSync()) {
return file;
}
await Future<void>.delayed(const Duration(seconds: 20));
}
throw StateError('Did not find vmservice out file after 400 seconds');
}
......@@ -78,14 +78,6 @@ tasks:
stage: devicelab_win
required_agent_capabilities: ["windows/android"]
uncaught_image_error_linux:
description: >
Ensures that an error thrown into the zone can be caught by the ImageStream
completer
stage: devicelab
required_agent_capabilities: ["linux/android"]
flaky: true
flutter_gallery_android__compile:
description: >
Collects various performance metrics of compiling the Flutter
......@@ -424,13 +416,6 @@ tasks:
stage: devicelab
required_agent_capabilities: ["mac/android"]
android_enable_twc:
description: >
Verifies that track-widget-creation can be enabled and disabled.
stage: devicelab
required_agent_capabilities: ["mac/android"]
flaky: true
android_defines_test:
description: >
Builds an APK with a --dart-define and verifies it can be used as a constant
......@@ -644,13 +629,6 @@ tasks:
stage: devicelab_ios
required_agent_capabilities: ["mac/ios"]
ios_enable_twc:
description: >
Verifies that track-widget-creation can be enabled and disabled.
stage: devicelab_ios
required_agent_capabilities: ["mac/ios"]
flaky: true
macos_chrome_dev_mode:
description: >
Run flutter web on the devicelab and hot restart.
......@@ -911,13 +889,6 @@ tasks:
stage: devicelab
required_agent_capabilities: ["linux-vm"]
web_enable_twc:
description: >
Verifies that track-widget-creation can be enabled and disabled.
stage: devicelab
required_agent_capabilities: ["linux-vm"]
flaky: true
# android_splash_screen_integration_test:
# description: >
# Runs end-to-end test of Flutter's Android splash behavior.
......
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