Commit 1a309702 authored by Alexander Aprelev's avatar Alexander Aprelev Committed by GitHub

Clone hot reload benchmark for --preview-dart-2 option. (#12251)

* Clone hot reload benchmark for --preview-dart-2 option.

* Get rid of linux and win preview_dart_2 (only android would be sufficient for now). Refactor code into lib/tasks

* Revert 2016 to 2017

* Mark new test as flaky
parent f06ef528
......@@ -2,34 +2,11 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'dart:io';
import 'dart:async';
import 'package:path/path.dart' as path;
import 'package:flutter_devicelab/framework/adb.dart';
import 'package:flutter_devicelab/tasks/hot_mode_tests.dart';
import 'package:flutter_devicelab/framework/framework.dart';
import 'package:flutter_devicelab/framework/utils.dart';
void main() {
task(() async {
final Device device = await devices.workingDevice;
await device.unlock();
final Directory appDir =
dir(path.join(flutterDirectory.path, 'examples/flutter_gallery'));
final File benchmarkFile = file(path.join(appDir.path, 'hot_benchmark.json'));
rm(benchmarkFile);
await inDirectory(appDir, () async {
return await flutter('run',
options: <String>['--hot', '-d', device.deviceId, '--benchmark', '--verbose'],
canFail: false);
});
return new TaskResult.successFromFile(benchmarkFile,
benchmarkScoreKeys: <String>[
'hotReloadMillisecondsToFrame',
'hotRestartMillisecondsToFrame',
'hotReloadDevFSSyncMilliseconds',
'hotReloadFlutterReassembleMilliseconds',
'hotReloadVMReloadMilliseconds',
]);
});
Future<Null> main() async {
await task(createHotModeTest());
}
// 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 'package:flutter_devicelab/tasks/hot_mode_tests.dart';
import 'package:flutter_devicelab/framework/framework.dart';
Future<Null> main() async {
await task(createHotModeTest(isPreviewDart2: true));
}
......@@ -2,8 +2,11 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'hot_mode_dev_cycle__benchmark.dart' as hot_mode_dev_cycle_benchmark;
import 'dart:async';
void main() {
hot_mode_dev_cycle_benchmark.main();
import 'package:flutter_devicelab/tasks/hot_mode_tests.dart';
import 'package:flutter_devicelab/framework/framework.dart';
Future<Null> main() async {
await task(createHotModeTest());
}
......@@ -2,8 +2,11 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'hot_mode_dev_cycle__benchmark.dart' as hot_mode_dev_cycle_benchmark;
import 'dart:async';
void main() {
hot_mode_dev_cycle_benchmark.main();
import 'package:flutter_devicelab/tasks/hot_mode_tests.dart';
import 'package:flutter_devicelab/framework/framework.dart';
Future<Null> main() async {
await task(createHotModeTest());
}
// 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:io';
import 'package:path/path.dart' as path;
import '../framework/adb.dart';
import '../framework/framework.dart';
import '../framework/utils.dart';
TaskFunction createHotModeTest({ bool isPreviewDart2: false }) {
return () async {
final Device device = await devices.workingDevice;
await device.unlock();
final Directory appDir =
dir(path.join(flutterDirectory.path, 'examples/flutter_gallery'));
final File benchmarkFile = file(path.join(appDir.path, 'hot_benchmark.json'));
rm(benchmarkFile);
final List<String> options = <String>[
'--hot', '-d', device.deviceId, '--benchmark', '--verbose'
];
if (isPreviewDart2)
options.add('--preview-dart-2');
await inDirectory(appDir, () async {
return await flutter('run', options: options, canFail: false);
});
return new TaskResult.successFromFile(benchmarkFile,
benchmarkScoreKeys: <String>[
'hotReloadMillisecondsToFrame',
'hotRestartMillisecondsToFrame',
'hotReloadDevFSSyncMilliseconds',
'hotReloadFlutterReassembleMilliseconds',
'hotReloadVMReloadMilliseconds',
]);
};
}
......@@ -96,6 +96,14 @@ tasks:
stage: devicelab
required_agent_capabilities: ["has-android-device"]
hot_mode_dev_cycle__preview_dart_2_benchmark:
description: >
Measures the performance of Dart VM hot patching feature under
--preview-dart-2 option, that enables Dart 2.0 frontend.
stage: devicelab
required_agent_capabilities: ["has-android-device"]
flaky: true
complex_layout_scroll_perf__memory:
description: >
Measures memory usage of the scroll performance test.
......
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