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
This commit is contained in:
committed by
GitHub
parent
f06ef528e9
commit
1a3097025d
@@ -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());
|
||||
}
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
// 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());
|
||||
}
|
||||
|
||||
38
dev/devicelab/lib/tasks/hot_mode_tests.dart
Normal file
38
dev/devicelab/lib/tasks/hot_mode_tests.dart
Normal file
@@ -0,0 +1,38 @@
|
||||
// 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.
|
||||
|
||||
Reference in New Issue
Block a user