This reverts commit 297c7b5cf2.
This commit is contained in:
@@ -9,6 +9,7 @@ import 'package:args/args.dart';
|
||||
import 'package:path/path.dart' as path;
|
||||
|
||||
import 'package:flutter_devicelab/framework/ab.dart';
|
||||
import 'package:flutter_devicelab/framework/cocoon.dart';
|
||||
import 'package:flutter_devicelab/framework/manifest.dart';
|
||||
import 'package:flutter_devicelab/framework/runner.dart';
|
||||
import 'package:flutter_devicelab/framework/task_result.dart';
|
||||
@@ -104,14 +105,46 @@ Future<void> main(List<String> rawArgs) async {
|
||||
if (args.wasParsed('ab')) {
|
||||
await _runABTest();
|
||||
} else {
|
||||
await runTasks(_taskNames,
|
||||
await _runTasks();
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> _runTasks() async {
|
||||
for (final String taskName in _taskNames) {
|
||||
section('Running task "$taskName"');
|
||||
final TaskResult result = await runTask(
|
||||
taskName,
|
||||
silent: silent,
|
||||
exitOnFirstTestFailure: exitOnFirstTestFailure,
|
||||
localEngine: localEngine,
|
||||
localEngineSrcPath: localEngineSrcPath,
|
||||
deviceId: deviceId,
|
||||
gitBranch: gitBranch,
|
||||
luciBuilder: luciBuilder,
|
||||
resultsPath: resultsPath,
|
||||
);
|
||||
|
||||
print('Task result:');
|
||||
print(const JsonEncoder.withIndent(' ').convert(result));
|
||||
section('Finished task "$taskName"');
|
||||
|
||||
if (resultsPath != null) {
|
||||
final Cocoon cocoon = Cocoon();
|
||||
await cocoon.writeTaskResultToFile(
|
||||
builderName: luciBuilder,
|
||||
gitBranch: gitBranch,
|
||||
result: result,
|
||||
resultsPath: resultsPath,
|
||||
);
|
||||
} else if (serviceAccountTokenFile != null) {
|
||||
final Cocoon cocoon = Cocoon(serviceAccountTokenPath: serviceAccountTokenFile);
|
||||
|
||||
/// Cocoon references LUCI tasks by the [luciBuilder] instead of [taskName].
|
||||
await cocoon.sendTaskResult(builderName: luciBuilder, result: result, gitBranch: gitBranch);
|
||||
}
|
||||
|
||||
if (!result.succeeded) {
|
||||
exitCode = 1;
|
||||
if (exitOnFirstTestFailure) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ import 'package:flutter_devicelab/tasks/gallery.dart';
|
||||
import 'package:flutter_devicelab/framework/adb.dart';
|
||||
import 'package:flutter_devicelab/framework/framework.dart';
|
||||
|
||||
Future<void> main(List<String> args) async {
|
||||
Future<void> main() async {
|
||||
deviceOperatingSystem = DeviceOperatingSystem.android;
|
||||
await task(createGalleryTransitionTest(args));
|
||||
await task(createGalleryTransitionTest());
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ import 'package:flutter_devicelab/tasks/gallery.dart';
|
||||
import 'package:flutter_devicelab/framework/adb.dart';
|
||||
import 'package:flutter_devicelab/framework/framework.dart';
|
||||
|
||||
Future<void> main(List<String> args) async {
|
||||
Future<void> main() async {
|
||||
deviceOperatingSystem = DeviceOperatingSystem.android;
|
||||
await task(createGalleryTransitionE2ETest(args));
|
||||
await task(createGalleryTransitionE2ETest());
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ import 'package:flutter_devicelab/tasks/gallery.dart';
|
||||
import 'package:flutter_devicelab/framework/adb.dart';
|
||||
import 'package:flutter_devicelab/framework/framework.dart';
|
||||
|
||||
Future<void> main(List<String> args) async {
|
||||
Future<void> main() async {
|
||||
deviceOperatingSystem = DeviceOperatingSystem.ios;
|
||||
await task(createGalleryTransitionE2ETest(args));
|
||||
await task(createGalleryTransitionE2ETest());
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ import 'package:flutter_devicelab/tasks/gallery.dart';
|
||||
import 'package:flutter_devicelab/framework/adb.dart';
|
||||
import 'package:flutter_devicelab/framework/framework.dart';
|
||||
|
||||
Future<void> main(List<String> args) async {
|
||||
Future<void> main() async {
|
||||
deviceOperatingSystem = DeviceOperatingSystem.ios;
|
||||
await task(createGalleryTransitionE2ETest(args));
|
||||
await task(createGalleryTransitionE2ETest());
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ import 'package:flutter_devicelab/tasks/gallery.dart';
|
||||
import 'package:flutter_devicelab/framework/adb.dart';
|
||||
import 'package:flutter_devicelab/framework/framework.dart';
|
||||
|
||||
Future<void> main(List<String> args) async {
|
||||
Future<void> main() async {
|
||||
deviceOperatingSystem = DeviceOperatingSystem.android;
|
||||
await task(createGalleryTransitionHybridTest(args));
|
||||
await task(createGalleryTransitionHybridTest());
|
||||
}
|
||||
|
||||
@@ -7,11 +7,11 @@ import 'package:flutter_devicelab/framework/adb.dart';
|
||||
import 'package:flutter_devicelab/framework/framework.dart';
|
||||
import 'package:flutter_devicelab/framework/task_result.dart';
|
||||
|
||||
Future<void> main(List<String> args) async {
|
||||
Future<void> main() async {
|
||||
deviceOperatingSystem = DeviceOperatingSystem.android;
|
||||
await task(() async {
|
||||
final TaskResult withoutSemantics = await createGalleryTransitionTest(args)();
|
||||
final TaskResult withSemantics = await createGalleryTransitionTest(args, semanticsEnabled: true)();
|
||||
final TaskResult withoutSemantics = await createGalleryTransitionTest()();
|
||||
final TaskResult withSemantics = await createGalleryTransitionTest(semanticsEnabled: true)();
|
||||
if (withSemantics.benchmarkScoreKeys.isEmpty || withoutSemantics.benchmarkScoreKeys.isEmpty) {
|
||||
String message = 'Lack of data';
|
||||
if (withSemantics.benchmarkScoreKeys.isEmpty) {
|
||||
|
||||
@@ -6,7 +6,7 @@ import 'package:flutter_devicelab/tasks/gallery.dart';
|
||||
import 'package:flutter_devicelab/framework/adb.dart';
|
||||
import 'package:flutter_devicelab/framework/framework.dart';
|
||||
|
||||
Future<void> main(List<String> args) async {
|
||||
Future<void> main() async {
|
||||
deviceOperatingSystem = DeviceOperatingSystem.ios;
|
||||
await task(createGalleryTransitionTest(args));
|
||||
await task(createGalleryTransitionTest());
|
||||
}
|
||||
|
||||
@@ -1,31 +0,0 @@
|
||||
// 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/build_test_task.dart';
|
||||
import 'package:flutter_devicelab/framework/adb.dart';
|
||||
import 'package:flutter_devicelab/framework/task_result.dart';
|
||||
|
||||
/// Smoke test of a successful task.
|
||||
Future<void> main(List<String> args) async {
|
||||
deviceOperatingSystem = DeviceOperatingSystem.fake;
|
||||
await task(FakeBuildTestTask(args));
|
||||
}
|
||||
|
||||
class FakeBuildTestTask extends BuildTestTask {
|
||||
FakeBuildTestTask(List<String> args) : super(args, runFlutterClean: false) {
|
||||
deviceOperatingSystem = DeviceOperatingSystem.fake;
|
||||
}
|
||||
|
||||
@override
|
||||
// In prod, tasks always run some unit of work and the test framework assumes
|
||||
// there will be some work done when managing the isolate. To fake this, add a delay.
|
||||
Future<void> build() => Future<void>.delayed(const Duration(milliseconds: 500));
|
||||
|
||||
@override
|
||||
Future<TaskResult> test() async {
|
||||
await Future<void>.delayed(const Duration(milliseconds: 500));
|
||||
return TaskResult.success(<String, String>{'benchmark': 'data'});
|
||||
}
|
||||
}
|
||||
@@ -5,12 +5,10 @@
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:args/command_runner.dart';
|
||||
import 'package:flutter_devicelab/command/test.dart';
|
||||
import 'package:flutter_devicelab/command/upload_metrics.dart';
|
||||
|
||||
final CommandRunner<void> runner =
|
||||
CommandRunner<void>('devicelab_runner', 'DeviceLab test runner for recording performance metrics on applications')
|
||||
..addCommand(TestCommand())
|
||||
..addCommand(UploadMetricsCommand());
|
||||
|
||||
Future<void> main(List<String> rawArgs) async {
|
||||
|
||||
Reference in New Issue
Block a user