Refactor compilation devicelab tests (#13218)
This fills out the following matrix: App: `flutter create` default app, Complex Layout, and Gallery. Platforms: Linux/Android, Mac/iOS, Windows/Android Build modes: full release, aot blobs, debug Dart: normal, 2.0 preview It also renames all the tests that used "build" to mean compilation build to use "compile" instead, so that it's much clearer on the dashboard. Also, mark some flaky tests that are no longer flaky as not flaky. Also, remove uses of call() since that's probably going to go away at some point.
This commit is contained in:
parent
909406ba25
commit
d104106e78
@ -6,9 +6,9 @@ import 'dart:async';
|
|||||||
|
|
||||||
import 'package:flutter_devicelab/framework/adb.dart';
|
import 'package:flutter_devicelab/framework/adb.dart';
|
||||||
import 'package:flutter_devicelab/framework/framework.dart';
|
import 'package:flutter_devicelab/framework/framework.dart';
|
||||||
import 'package:flutter_devicelab/tasks/size_tests.dart';
|
import 'package:flutter_devicelab/tasks/perf_tests.dart';
|
||||||
|
|
||||||
Future<Null> main() async {
|
Future<Null> main() async {
|
||||||
deviceOperatingSystem = DeviceOperatingSystem.android;
|
deviceOperatingSystem = DeviceOperatingSystem.android;
|
||||||
await task(createBasicMaterialAppSizeTest());
|
await task(createBasicMaterialCompileTest());
|
||||||
}
|
}
|
@ -6,9 +6,9 @@ import 'dart:async';
|
|||||||
|
|
||||||
import 'package:flutter_devicelab/framework/adb.dart';
|
import 'package:flutter_devicelab/framework/adb.dart';
|
||||||
import 'package:flutter_devicelab/framework/framework.dart';
|
import 'package:flutter_devicelab/framework/framework.dart';
|
||||||
import 'package:flutter_devicelab/tasks/size_tests.dart';
|
import 'package:flutter_devicelab/tasks/perf_tests.dart';
|
||||||
|
|
||||||
Future<Null> main() async {
|
Future<Null> main() async {
|
||||||
deviceOperatingSystem = DeviceOperatingSystem.ios;
|
deviceOperatingSystem = DeviceOperatingSystem.ios;
|
||||||
await task(createBasicMaterialAppSizeTest());
|
await task(createBasicMaterialCompileTest());
|
||||||
}
|
}
|
14
dev/devicelab/bin/tasks/basic_material_app_win__compile.dart
Normal file
14
dev/devicelab/bin/tasks/basic_material_app_win__compile.dart
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
// Copyright 2016 The Chromium 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:async';
|
||||||
|
|
||||||
|
import 'package:flutter_devicelab/framework/adb.dart';
|
||||||
|
import 'package:flutter_devicelab/framework/framework.dart';
|
||||||
|
import 'package:flutter_devicelab/tasks/perf_tests.dart';
|
||||||
|
|
||||||
|
Future<Null> main() async {
|
||||||
|
deviceOperatingSystem = DeviceOperatingSystem.android;
|
||||||
|
await task(createBasicMaterialCompileTest());
|
||||||
|
}
|
14
dev/devicelab/bin/tasks/complex_layout_android__compile.dart
Normal file
14
dev/devicelab/bin/tasks/complex_layout_android__compile.dart
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
// Copyright 2016 The Chromium 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:async';
|
||||||
|
|
||||||
|
import 'package:flutter_devicelab/framework/adb.dart';
|
||||||
|
import 'package:flutter_devicelab/framework/framework.dart';
|
||||||
|
import 'package:flutter_devicelab/tasks/perf_tests.dart';
|
||||||
|
|
||||||
|
Future<Null> main() async {
|
||||||
|
deviceOperatingSystem = DeviceOperatingSystem.android;
|
||||||
|
await task(createComplexLayoutCompileTest());
|
||||||
|
}
|
@ -5,8 +5,10 @@
|
|||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
|
|
||||||
import 'package:flutter_devicelab/tasks/perf_tests.dart';
|
import 'package:flutter_devicelab/tasks/perf_tests.dart';
|
||||||
|
import 'package:flutter_devicelab/framework/adb.dart';
|
||||||
import 'package:flutter_devicelab/framework/framework.dart';
|
import 'package:flutter_devicelab/framework/framework.dart';
|
||||||
|
|
||||||
Future<Null> main() async {
|
Future<Null> main() async {
|
||||||
await task(createComplexLayoutBuildTest());
|
deviceOperatingSystem = DeviceOperatingSystem.ios;
|
||||||
|
await task(createComplexLayoutCompileTest());
|
||||||
}
|
}
|
14
dev/devicelab/bin/tasks/complex_layout_win__compile.dart
Normal file
14
dev/devicelab/bin/tasks/complex_layout_win__compile.dart
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
// Copyright 2016 The Chromium 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:async';
|
||||||
|
|
||||||
|
import 'package:flutter_devicelab/framework/adb.dart';
|
||||||
|
import 'package:flutter_devicelab/framework/framework.dart';
|
||||||
|
import 'package:flutter_devicelab/tasks/perf_tests.dart';
|
||||||
|
|
||||||
|
Future<Null> main() async {
|
||||||
|
deviceOperatingSystem = DeviceOperatingSystem.android;
|
||||||
|
await task(createComplexLayoutCompileTest());
|
||||||
|
}
|
@ -1,12 +0,0 @@
|
|||||||
// Copyright 2017 The Chromium 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:async';
|
|
||||||
|
|
||||||
import 'package:flutter_devicelab/tasks/perf_tests.dart';
|
|
||||||
import 'package:flutter_devicelab/framework/framework.dart';
|
|
||||||
|
|
||||||
Future<Null> main() async {
|
|
||||||
await task(createFlutterGalleryPreviewDart2BuildTest());
|
|
||||||
}
|
|
@ -0,0 +1,14 @@
|
|||||||
|
// Copyright 2016 The Chromium 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:async';
|
||||||
|
|
||||||
|
import 'package:flutter_devicelab/framework/adb.dart';
|
||||||
|
import 'package:flutter_devicelab/framework/framework.dart';
|
||||||
|
import 'package:flutter_devicelab/tasks/perf_tests.dart';
|
||||||
|
|
||||||
|
Future<Null> main() async {
|
||||||
|
deviceOperatingSystem = DeviceOperatingSystem.android;
|
||||||
|
await task(createFlutterGalleryCompileTest());
|
||||||
|
}
|
@ -4,9 +4,11 @@
|
|||||||
|
|
||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
|
|
||||||
import 'package:flutter_devicelab/tasks/perf_tests.dart';
|
import 'package:flutter_devicelab/framework/adb.dart';
|
||||||
import 'package:flutter_devicelab/framework/framework.dart';
|
import 'package:flutter_devicelab/framework/framework.dart';
|
||||||
|
import 'package:flutter_devicelab/tasks/perf_tests.dart';
|
||||||
|
|
||||||
Future<Null> main() async {
|
Future<Null> main() async {
|
||||||
await task(createFlutterGalleryBuildTest());
|
deviceOperatingSystem = DeviceOperatingSystem.ios;
|
||||||
|
await task(createFlutterGalleryCompileTest());
|
||||||
}
|
}
|
@ -1,11 +0,0 @@
|
|||||||
// Copyright (c) 2017 The Chromium 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:async';
|
|
||||||
|
|
||||||
import 'flutter_gallery__build.dart' as flutter_gallery_build;
|
|
||||||
|
|
||||||
Future<Null> main() async {
|
|
||||||
await flutter_gallery_build.main();
|
|
||||||
}
|
|
14
dev/devicelab/bin/tasks/flutter_gallery_win__compile.dart
Normal file
14
dev/devicelab/bin/tasks/flutter_gallery_win__compile.dart
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
// Copyright 2016 The Chromium 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:async';
|
||||||
|
|
||||||
|
import 'package:flutter_devicelab/framework/adb.dart';
|
||||||
|
import 'package:flutter_devicelab/framework/framework.dart';
|
||||||
|
import 'package:flutter_devicelab/tasks/perf_tests.dart';
|
||||||
|
|
||||||
|
Future<Null> main() async {
|
||||||
|
deviceOperatingSystem = DeviceOperatingSystem.android;
|
||||||
|
await task(createFlutterGalleryCompileTest());
|
||||||
|
}
|
@ -4,6 +4,7 @@
|
|||||||
|
|
||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
import 'dart:convert' show JSON;
|
import 'dart:convert' show JSON;
|
||||||
|
import 'dart:io';
|
||||||
|
|
||||||
import '../framework/adb.dart';
|
import '../framework/adb.dart';
|
||||||
import '../framework/framework.dart';
|
import '../framework/framework.dart';
|
||||||
@ -15,7 +16,7 @@ TaskFunction createComplexLayoutScrollPerfTest() {
|
|||||||
'${flutterDirectory.path}/dev/benchmarks/complex_layout',
|
'${flutterDirectory.path}/dev/benchmarks/complex_layout',
|
||||||
'test_driver/scroll_perf.dart',
|
'test_driver/scroll_perf.dart',
|
||||||
'complex_layout_scroll_perf',
|
'complex_layout_scroll_perf',
|
||||||
);
|
).run;
|
||||||
}
|
}
|
||||||
|
|
||||||
TaskFunction createComplexLayoutScrollMemoryTest() {
|
TaskFunction createComplexLayoutScrollMemoryTest() {
|
||||||
@ -23,38 +24,34 @@ TaskFunction createComplexLayoutScrollMemoryTest() {
|
|||||||
'${flutterDirectory.path}/dev/benchmarks/complex_layout',
|
'${flutterDirectory.path}/dev/benchmarks/complex_layout',
|
||||||
'com.yourcompany.complexLayout',
|
'com.yourcompany.complexLayout',
|
||||||
testTarget: 'test_driver/scroll_perf.dart',
|
testTarget: 'test_driver/scroll_perf.dart',
|
||||||
);
|
).run;
|
||||||
}
|
}
|
||||||
|
|
||||||
TaskFunction createFlutterGalleryStartupTest() {
|
TaskFunction createFlutterGalleryStartupTest() {
|
||||||
return new StartupTest(
|
return new StartupTest(
|
||||||
'${flutterDirectory.path}/examples/flutter_gallery',
|
'${flutterDirectory.path}/examples/flutter_gallery',
|
||||||
);
|
).run;
|
||||||
}
|
}
|
||||||
|
|
||||||
TaskFunction createComplexLayoutStartupTest() {
|
TaskFunction createComplexLayoutStartupTest() {
|
||||||
return new StartupTest(
|
return new StartupTest(
|
||||||
'${flutterDirectory.path}/dev/benchmarks/complex_layout',
|
'${flutterDirectory.path}/dev/benchmarks/complex_layout',
|
||||||
);
|
).run;
|
||||||
}
|
}
|
||||||
|
|
||||||
TaskFunction createFlutterGalleryBuildTest() {
|
TaskFunction createFlutterGalleryCompileTest() {
|
||||||
return new BuildTest('${flutterDirectory.path}/examples/flutter_gallery');
|
return new CompileTest('${flutterDirectory.path}/examples/flutter_gallery').run;
|
||||||
}
|
}
|
||||||
|
|
||||||
TaskFunction createFlutterGalleryPreviewDart2BuildTest() {
|
TaskFunction createComplexLayoutCompileTest() {
|
||||||
return new BuildTest('${flutterDirectory.path}/examples/flutter_gallery', previewDart2: true);
|
return new CompileTest('${flutterDirectory.path}/dev/benchmarks/complex_layout').run;
|
||||||
}
|
|
||||||
|
|
||||||
TaskFunction createComplexLayoutBuildTest() {
|
|
||||||
return new BuildTest('${flutterDirectory.path}/dev/benchmarks/complex_layout');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
TaskFunction createHelloWorldMemoryTest() {
|
TaskFunction createHelloWorldMemoryTest() {
|
||||||
return new MemoryTest(
|
return new MemoryTest(
|
||||||
'${flutterDirectory.path}/examples/hello_world',
|
'${flutterDirectory.path}/examples/hello_world',
|
||||||
'io.flutter.examples.hello_world',
|
'io.flutter.examples.hello_world',
|
||||||
);
|
).run;
|
||||||
}
|
}
|
||||||
|
|
||||||
TaskFunction createGalleryNavigationMemoryTest() {
|
TaskFunction createGalleryNavigationMemoryTest() {
|
||||||
@ -62,7 +59,7 @@ TaskFunction createGalleryNavigationMemoryTest() {
|
|||||||
'${flutterDirectory.path}/examples/flutter_gallery',
|
'${flutterDirectory.path}/examples/flutter_gallery',
|
||||||
'io.flutter.examples.gallery',
|
'io.flutter.examples.gallery',
|
||||||
testTarget: 'test_driver/memory_nav.dart',
|
testTarget: 'test_driver/memory_nav.dart',
|
||||||
);
|
).run;
|
||||||
}
|
}
|
||||||
|
|
||||||
TaskFunction createGalleryBackButtonMemoryTest() {
|
TaskFunction createGalleryBackButtonMemoryTest() {
|
||||||
@ -70,16 +67,29 @@ TaskFunction createGalleryBackButtonMemoryTest() {
|
|||||||
'${flutterDirectory.path}/examples/flutter_gallery',
|
'${flutterDirectory.path}/examples/flutter_gallery',
|
||||||
'io.flutter.examples.gallery',
|
'io.flutter.examples.gallery',
|
||||||
'io.flutter.examples.gallery.MainActivity',
|
'io.flutter.examples.gallery.MainActivity',
|
||||||
);
|
).run;
|
||||||
}
|
}
|
||||||
|
|
||||||
TaskFunction createFlutterViewStartupTest() {
|
TaskFunction createFlutterViewStartupTest() {
|
||||||
return new StartupTest(
|
return new StartupTest(
|
||||||
'${flutterDirectory.path}/examples/flutter_view',
|
'${flutterDirectory.path}/examples/flutter_view',
|
||||||
reportMetrics: false,
|
reportMetrics: false,
|
||||||
);
|
).run;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TaskFunction createBasicMaterialCompileTest() {
|
||||||
|
return () async {
|
||||||
|
const String sampleAppName = 'sample_flutter_app';
|
||||||
|
final Directory sampleDir = dir('${Directory.systemTemp.path}/$sampleAppName');
|
||||||
|
|
||||||
|
if (await sampleDir.exists())
|
||||||
|
rmTree(sampleDir);
|
||||||
|
|
||||||
|
return new CompileTest(sampleDir.path).run();
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/// Measure application startup performance.
|
/// Measure application startup performance.
|
||||||
class StartupTest {
|
class StartupTest {
|
||||||
static const Duration _startupTimeout = const Duration(minutes: 5);
|
static const Duration _startupTimeout = const Duration(minutes: 5);
|
||||||
@ -89,7 +99,7 @@ class StartupTest {
|
|||||||
final String testDirectory;
|
final String testDirectory;
|
||||||
final bool reportMetrics;
|
final bool reportMetrics;
|
||||||
|
|
||||||
Future<TaskResult> call() async {
|
Future<TaskResult> run() async {
|
||||||
return await inDirectory(testDirectory, () async {
|
return await inDirectory(testDirectory, () async {
|
||||||
final String deviceId = (await devices.workingDevice).deviceId;
|
final String deviceId = (await devices.workingDevice).deviceId;
|
||||||
await flutter('packages', options: <String>['get']);
|
await flutter('packages', options: <String>['get']);
|
||||||
@ -119,14 +129,13 @@ class StartupTest {
|
|||||||
/// Measures application runtime performance, specifically per-frame
|
/// Measures application runtime performance, specifically per-frame
|
||||||
/// performance.
|
/// performance.
|
||||||
class PerfTest {
|
class PerfTest {
|
||||||
|
|
||||||
const PerfTest(this.testDirectory, this.testTarget, this.timelineFileName);
|
const PerfTest(this.testDirectory, this.testTarget, this.timelineFileName);
|
||||||
|
|
||||||
final String testDirectory;
|
final String testDirectory;
|
||||||
final String testTarget;
|
final String testTarget;
|
||||||
final String timelineFileName;
|
final String timelineFileName;
|
||||||
|
|
||||||
Future<TaskResult> call() {
|
Future<TaskResult> run() {
|
||||||
return inDirectory(testDirectory, () async {
|
return inDirectory(testDirectory, () async {
|
||||||
final Device device = await devices.workingDevice;
|
final Device device = await devices.workingDevice;
|
||||||
await device.unlock();
|
await device.unlock();
|
||||||
@ -166,32 +175,39 @@ class PerfTest {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Measures how long it takes to build a Flutter app and how big the compiled
|
/// Measures how long it takes to compile a Flutter app and how big the compiled
|
||||||
/// code is.
|
/// code is.
|
||||||
class BuildTest {
|
class CompileTest {
|
||||||
const BuildTest(this.testDirectory, {this.previewDart2: false});
|
const CompileTest(this.testDirectory);
|
||||||
|
|
||||||
final bool previewDart2;
|
|
||||||
final String testDirectory;
|
final String testDirectory;
|
||||||
|
|
||||||
Future<TaskResult> call() async {
|
Future<TaskResult> run() async {
|
||||||
return await inDirectory(testDirectory, () async {
|
return await inDirectory(testDirectory, () async {
|
||||||
final Device device = await devices.workingDevice;
|
final Device device = await devices.workingDevice;
|
||||||
await device.unlock();
|
await device.unlock();
|
||||||
await flutter('packages', options: <String>['get']);
|
await flutter('packages', options: <String>['get']);
|
||||||
|
|
||||||
final Map<String, dynamic> aotResults = await _buildAot(previewDart2);
|
|
||||||
final Map<String, dynamic> debugResults = await _buildDebug(previewDart2);
|
|
||||||
|
|
||||||
final Map<String, dynamic> metrics = <String, dynamic>{}
|
final Map<String, dynamic> metrics = <String, dynamic>{}
|
||||||
..addAll(aotResults)
|
..addAll(await _compileAot())
|
||||||
..addAll(debugResults);
|
..addAll(await _compileApp())
|
||||||
|
..addAll(await _compileDebug())
|
||||||
|
..addAll(_suffix(await _compileAot(previewDart2: true), '__preview_dart_2'))
|
||||||
|
..addAll(_suffix(await _compileApp(previewDart2: true), '__preview_dart_2'))
|
||||||
|
..addAll(_suffix(await _compileDebug(previewDart2: true), '__preview_dart_2'));
|
||||||
|
|
||||||
return new TaskResult.success(metrics, benchmarkScoreKeys: metrics.keys.toList());
|
return new TaskResult.success(metrics, benchmarkScoreKeys: metrics.keys.toList());
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
static Future<Map<String, dynamic>> _buildAot(bool previewDart2) async {
|
static Map<String, dynamic> _suffix(Map<String, dynamic> map, String suffix) {
|
||||||
|
return new Map<String, dynamic>.fromIterables(
|
||||||
|
map.keys.map<String>((String key) => '$key$suffix'),
|
||||||
|
map.values,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
static Future<Map<String, dynamic>> _compileAot({ bool previewDart2: false }) async {
|
||||||
await flutter('clean');
|
await flutter('clean');
|
||||||
final Stopwatch watch = new Stopwatch()..start();
|
final Stopwatch watch = new Stopwatch()..start();
|
||||||
final List<String> options = <String>[
|
final List<String> options = <String>[
|
||||||
@ -203,23 +219,52 @@ class BuildTest {
|
|||||||
];
|
];
|
||||||
if (previewDart2)
|
if (previewDart2)
|
||||||
options.add('--preview-dart-2');
|
options.add('--preview-dart-2');
|
||||||
final String buildLog = await evalFlutter('build', options: options);
|
final String compileLog = await evalFlutter('build', options: options);
|
||||||
watch.stop();
|
watch.stop();
|
||||||
|
|
||||||
final RegExp metricExpression = new RegExp(r'([a-zA-Z]+)\(CodeSize\)\: (\d+)');
|
final RegExp metricExpression = new RegExp(r'([a-zA-Z]+)\(CodeSize\)\: (\d+)');
|
||||||
final Map<String, dynamic> metrics = new Map<String, dynamic>.fromIterable(
|
final Map<String, dynamic> metrics = new Map<String, dynamic>.fromIterable(
|
||||||
metricExpression.allMatches(buildLog),
|
metricExpression.allMatches(compileLog),
|
||||||
key: (Match m) => _sdkNameToMetricName(m.group(1)),
|
key: (Match m) => _sdkNameToMetricName(m.group(1)),
|
||||||
value: (Match m) => int.parse(m.group(2)),
|
value: (Match m) => int.parse(m.group(2)),
|
||||||
);
|
);
|
||||||
metrics['aot_snapshot_build_millis'] = watch.elapsedMilliseconds;
|
metrics['aot_snapshot_compile_millis'] = watch.elapsedMilliseconds;
|
||||||
|
|
||||||
return metrics;
|
return metrics;
|
||||||
}
|
}
|
||||||
|
|
||||||
static Future<Map<String, dynamic>> _buildDebug(bool previewDart2) async {
|
static Future<Map<String, dynamic>> _compileApp({ bool previewDart2: false }) async {
|
||||||
await flutter('clean');
|
await flutter('clean');
|
||||||
|
final Stopwatch watch = new Stopwatch();
|
||||||
|
int releaseSizeInBytes;
|
||||||
|
final List<String> options = <String>['--release'];
|
||||||
|
if (previewDart2)
|
||||||
|
options.add('--preview-dart-2');
|
||||||
|
if (deviceOperatingSystem == DeviceOperatingSystem.ios) {
|
||||||
|
options.add('ios');
|
||||||
|
await prepareProvisioningCertificates(cwd);
|
||||||
|
watch.start();
|
||||||
|
await flutter('build', options: options);
|
||||||
|
watch.stop();
|
||||||
|
// IPAs are created manually AFAICT
|
||||||
|
await exec('tar', <String>['-zcf', 'build/app.ipa', 'build/ios/Release-iphoneos/Runner.app/']);
|
||||||
|
releaseSizeInBytes = await file('$cwd/build/app.ipa').length();
|
||||||
|
} else {
|
||||||
|
options.add('apk');
|
||||||
|
watch.start();
|
||||||
|
await flutter('build', options: options);
|
||||||
|
watch.stop();
|
||||||
|
releaseSizeInBytes = await file('$cwd/build/app/outputs/apk/app-release.apk').length();
|
||||||
|
}
|
||||||
|
|
||||||
|
return <String, dynamic>{
|
||||||
|
'release_full_compile_millis': watch.elapsedMilliseconds,
|
||||||
|
'release_size_bytes': releaseSizeInBytes,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
static Future<Map<String, dynamic>> _compileDebug({ bool previewDart2: false }) async {
|
||||||
|
await flutter('clean');
|
||||||
final Stopwatch watch = new Stopwatch();
|
final Stopwatch watch = new Stopwatch();
|
||||||
if (deviceOperatingSystem == DeviceOperatingSystem.ios) {
|
if (deviceOperatingSystem == DeviceOperatingSystem.ios) {
|
||||||
await prepareProvisioningCertificates(cwd);
|
await prepareProvisioningCertificates(cwd);
|
||||||
@ -236,7 +281,7 @@ class BuildTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return <String, dynamic>{
|
return <String, dynamic>{
|
||||||
'debug_full_build_millis': watch.elapsedMilliseconds,
|
'debug_full_compile_millis': watch.elapsedMilliseconds,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -268,7 +313,7 @@ class MemoryTest {
|
|||||||
/// If not specified, then the test will start the app, gather statistics, and then exit.
|
/// If not specified, then the test will start the app, gather statistics, and then exit.
|
||||||
final String testTarget;
|
final String testTarget;
|
||||||
|
|
||||||
Future<TaskResult> call() {
|
Future<TaskResult> run() {
|
||||||
return inDirectory(testDirectory, () async {
|
return inDirectory(testDirectory, () async {
|
||||||
final Device device = await devices.workingDevice;
|
final Device device = await devices.workingDevice;
|
||||||
await device.unlock();
|
await device.unlock();
|
||||||
@ -330,7 +375,7 @@ class AndroidBackButtonMemoryTest {
|
|||||||
final String packageName;
|
final String packageName;
|
||||||
final String activityName;
|
final String activityName;
|
||||||
|
|
||||||
Future<TaskResult> call() {
|
Future<TaskResult> run() {
|
||||||
return inDirectory(testDirectory, () async {
|
return inDirectory(testDirectory, () async {
|
||||||
if (deviceOperatingSystem != DeviceOperatingSystem.android) {
|
if (deviceOperatingSystem != DeviceOperatingSystem.android) {
|
||||||
throw 'This test is only supported on Android';
|
throw 'This test is only supported on Android';
|
||||||
|
@ -1,58 +0,0 @@
|
|||||||
// Copyright 2016 The Chromium 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:io';
|
|
||||||
|
|
||||||
import 'package:flutter_devicelab/framework/adb.dart';
|
|
||||||
|
|
||||||
import '../framework/framework.dart';
|
|
||||||
import '../framework/ios.dart';
|
|
||||||
import '../framework/utils.dart';
|
|
||||||
|
|
||||||
TaskFunction createBasicMaterialAppSizeTest() {
|
|
||||||
return () async {
|
|
||||||
const String sampleAppName = 'sample_flutter_app';
|
|
||||||
final Directory sampleDir = dir('${Directory.systemTemp.path}/$sampleAppName');
|
|
||||||
|
|
||||||
if (await sampleDir.exists())
|
|
||||||
rmTree(sampleDir);
|
|
||||||
|
|
||||||
final Stopwatch watch = new Stopwatch();
|
|
||||||
int releaseSizeInBytes;
|
|
||||||
|
|
||||||
await inDirectory(Directory.systemTemp, () async {
|
|
||||||
await flutter('create', options: <String>[sampleAppName]);
|
|
||||||
|
|
||||||
if (!(await sampleDir.exists()))
|
|
||||||
throw 'Failed to create sample Flutter app in ${sampleDir.path}';
|
|
||||||
|
|
||||||
await inDirectory(sampleDir, () async {
|
|
||||||
await flutter('packages', options: <String>['get']);
|
|
||||||
await flutter('clean');
|
|
||||||
|
|
||||||
if (deviceOperatingSystem == DeviceOperatingSystem.ios) {
|
|
||||||
await prepareProvisioningCertificates(sampleDir.path);
|
|
||||||
watch.start();
|
|
||||||
await flutter('build', options: <String>['ios', '--release']);
|
|
||||||
watch.stop();
|
|
||||||
// IPAs are created manually AFAICT
|
|
||||||
await exec('tar', <String>['-zcf', 'build/app.ipa', 'build/ios/Release-iphoneos/Runner.app/']);
|
|
||||||
releaseSizeInBytes = await file('${sampleDir.path}/build/app.ipa').length();
|
|
||||||
} else {
|
|
||||||
watch.start();
|
|
||||||
await flutter('build', options: <String>['apk', '--release']);
|
|
||||||
watch.stop();
|
|
||||||
releaseSizeInBytes = await file('${sampleDir.path}/build/app/outputs/apk/app-release.apk').length();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
return new TaskResult.success(
|
|
||||||
<String, dynamic>{
|
|
||||||
'release_size_in_bytes': releaseSizeInBytes,
|
|
||||||
'build_time_millis': watch.elapsedMilliseconds,
|
|
||||||
},
|
|
||||||
benchmarkScoreKeys: <String>['release_size_in_bytes', 'build_time_millis']);
|
|
||||||
};
|
|
||||||
}
|
|
@ -32,23 +32,74 @@
|
|||||||
# a custom task timeout, specified in minutes.
|
# a custom task timeout, specified in minutes.
|
||||||
|
|
||||||
tasks:
|
tasks:
|
||||||
# Deviceless tests
|
# Tests of compiling in a variety of modes
|
||||||
|
|
||||||
# TODO: make these not require "has-android-device"; it is only there to
|
complex_layout_android__compile:
|
||||||
# ensure we have the Android SDK.
|
|
||||||
|
|
||||||
complex_layout__build:
|
|
||||||
description: >
|
description: >
|
||||||
Collects various performance metrics from AOT builds of the Complex
|
Collects various performance metrics of compiling the Complex
|
||||||
Layout sample app.
|
Layout sample app for Android from Linux.
|
||||||
stage: devicelab
|
stage: devicelab
|
||||||
required_agent_capabilities: ["has-android-device"]
|
required_agent_capabilities: ["linux/android"]
|
||||||
|
flaky: true
|
||||||
|
|
||||||
basic_material_app__size:
|
complex_layout_ios__compile:
|
||||||
description: >
|
description: >
|
||||||
Measures the APK size of a basic material app.
|
Collects various performance metrics of compiling the Complex
|
||||||
|
Layout sample app for iOS from Mac.
|
||||||
|
stage: devicelab_ios
|
||||||
|
required_agent_capabilities: ["has-ios-device"]
|
||||||
|
flaky: true
|
||||||
|
|
||||||
|
complex_layout_win__compile:
|
||||||
|
description: >
|
||||||
|
Collects various performance metrics of compiling the Complex
|
||||||
|
Layout for Android from Windows.
|
||||||
|
stage: devicelab_win
|
||||||
|
required_agent_capabilities: ["windows"]
|
||||||
|
|
||||||
|
basic_material_app_android__compile:
|
||||||
|
description: >
|
||||||
|
Collects various performance metrics of compiling the default
|
||||||
|
app for Android from Linux.
|
||||||
stage: devicelab
|
stage: devicelab
|
||||||
required_agent_capabilities: ["has-android-device"]
|
required_agent_capabilities: ["linux/android"]
|
||||||
|
flaky: true
|
||||||
|
|
||||||
|
basic_material_app_ios__compile:
|
||||||
|
description: >
|
||||||
|
Collects various performance metrics of compiling the default
|
||||||
|
app for iOS from Mac.
|
||||||
|
stage: devicelab_ios
|
||||||
|
required_agent_capabilities: ["has-ios-device"]
|
||||||
|
flaky: true
|
||||||
|
|
||||||
|
basic_material_app_win__compile:
|
||||||
|
description: >
|
||||||
|
Collects various performance metrics of compiling the default
|
||||||
|
app for Android from Windows.
|
||||||
|
stage: devicelab_win
|
||||||
|
required_agent_capabilities: ["windows"]
|
||||||
|
|
||||||
|
flutter_gallery_android__compile:
|
||||||
|
description: >
|
||||||
|
Collects various performance metrics of compiling the Flutter
|
||||||
|
Gallery for Android from Linux.
|
||||||
|
stage: devicelab
|
||||||
|
required_agent_capabilities: ["linux/android"]
|
||||||
|
|
||||||
|
flutter_gallery_ios__compile:
|
||||||
|
description: >
|
||||||
|
Collects various performance metrics of compiling the Flutter
|
||||||
|
Gallery for iOS from Mac.
|
||||||
|
stage: devicelab_ios
|
||||||
|
required_agent_capabilities: ["has-ios-device"]
|
||||||
|
|
||||||
|
flutter_gallery_win__compile:
|
||||||
|
description: >
|
||||||
|
Collects various performance metrics of compiling the Flutter
|
||||||
|
Gallery for Android from Windows.
|
||||||
|
stage: devicelab_win
|
||||||
|
required_agent_capabilities: ["windows"]
|
||||||
|
|
||||||
# Android on-device tests
|
# Android on-device tests
|
||||||
|
|
||||||
@ -197,7 +248,6 @@ tasks:
|
|||||||
Checks that external UIs work on iOS.
|
Checks that external UIs work on iOS.
|
||||||
stage: devicelab_ios
|
stage: devicelab_ios
|
||||||
required_agent_capabilities: ["has-ios-device"]
|
required_agent_capabilities: ["has-ios-device"]
|
||||||
flaky: true
|
|
||||||
|
|
||||||
channels_integration_test_ios:
|
channels_integration_test_ios:
|
||||||
description: >
|
description: >
|
||||||
@ -229,14 +279,12 @@ tasks:
|
|||||||
Measures the startup time of the Flutter Gallery app on iOS.
|
Measures the startup time of the Flutter Gallery app on iOS.
|
||||||
stage: devicelab_ios
|
stage: devicelab_ios
|
||||||
required_agent_capabilities: ["has-ios-device"]
|
required_agent_capabilities: ["has-ios-device"]
|
||||||
flaky: true
|
|
||||||
|
|
||||||
complex_layout_ios__start_up:
|
complex_layout_ios__start_up:
|
||||||
description: >
|
description: >
|
||||||
Measures the startup time of the Complex Layout sample app on iOS.
|
Measures the startup time of the Complex Layout sample app on iOS.
|
||||||
stage: devicelab_ios
|
stage: devicelab_ios
|
||||||
required_agent_capabilities: ["has-ios-device"]
|
required_agent_capabilities: ["has-ios-device"]
|
||||||
flaky: true
|
|
||||||
|
|
||||||
flutter_gallery_ios__transition_perf:
|
flutter_gallery_ios__transition_perf:
|
||||||
description: >
|
description: >
|
||||||
@ -245,12 +293,6 @@ tasks:
|
|||||||
stage: devicelab_ios
|
stage: devicelab_ios
|
||||||
required_agent_capabilities: ["has-ios-device"]
|
required_agent_capabilities: ["has-ios-device"]
|
||||||
|
|
||||||
basic_material_app_ios__size:
|
|
||||||
description: >
|
|
||||||
Measures the IPA size of a basic material app.
|
|
||||||
stage: devicelab_ios
|
|
||||||
required_agent_capabilities: ["has-ios-device"]
|
|
||||||
|
|
||||||
microbenchmarks_ios:
|
microbenchmarks_ios:
|
||||||
description: >
|
description: >
|
||||||
Runs benchmarks from dev/benchmarks/microbenchmarks on iOS.
|
Runs benchmarks from dev/benchmarks/microbenchmarks on iOS.
|
||||||
@ -259,12 +301,12 @@ tasks:
|
|||||||
timeout_in_minutes: 30
|
timeout_in_minutes: 30
|
||||||
flaky: true
|
flaky: true
|
||||||
|
|
||||||
# flutter_view_ios__start_up:
|
flutter_view_ios__start_up:
|
||||||
# description: >
|
description: >
|
||||||
# Verifies that Flutter View can be used from an iOS project.
|
Verifies that Flutter View can be used from an iOS project.
|
||||||
# stage: devicelab_ios
|
stage: devicelab_ios
|
||||||
# required_agent_capabilities: ["has-ios-device"]
|
required_agent_capabilities: ["has-ios-device"]
|
||||||
# flaky: true
|
flaky: true
|
||||||
|
|
||||||
integration_ui_ios:
|
integration_ui_ios:
|
||||||
description: >
|
description: >
|
||||||
@ -292,13 +334,6 @@ tasks:
|
|||||||
stage: devicelab_win
|
stage: devicelab_win
|
||||||
required_agent_capabilities: ["windows"]
|
required_agent_capabilities: ["windows"]
|
||||||
|
|
||||||
flutter_gallery_win__build:
|
|
||||||
description: >
|
|
||||||
Collects various performance metrics from AOT builds of the Flutter
|
|
||||||
Gallery on Windows.
|
|
||||||
stage: devicelab_win
|
|
||||||
required_agent_capabilities: ["windows"]
|
|
||||||
|
|
||||||
hot_mode_dev_cycle_win__benchmark:
|
hot_mode_dev_cycle_win__benchmark:
|
||||||
description: >
|
description: >
|
||||||
Measures the performance of Dart VM hot patching feature on Windows.
|
Measures the performance of Dart VM hot patching feature on Windows.
|
||||||
@ -325,20 +360,6 @@ tasks:
|
|||||||
stage: devicelab
|
stage: devicelab
|
||||||
required_agent_capabilities: ["linux/android"]
|
required_agent_capabilities: ["linux/android"]
|
||||||
|
|
||||||
flutter_gallery__build:
|
|
||||||
description: >
|
|
||||||
Collects various performance metrics from AOT builds of the Flutter
|
|
||||||
Gallery.
|
|
||||||
stage: devicelab
|
|
||||||
required_agent_capabilities: ["linux/android"]
|
|
||||||
|
|
||||||
flutter_gallery__preview_dart_2_build:
|
|
||||||
description: >
|
|
||||||
Collects various performance metrics from AOT builds of the Flutter
|
|
||||||
Gallery under --preview-dart-2 that enables new Dart 2.0 frontend.
|
|
||||||
stage: devicelab
|
|
||||||
required_agent_capabilities: ["linux/android"]
|
|
||||||
|
|
||||||
flutter_gallery__start_up:
|
flutter_gallery__start_up:
|
||||||
description: >
|
description: >
|
||||||
Measures the startup time of the Flutter Gallery app on Android.
|
Measures the startup time of the Flutter Gallery app on Android.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user