[devicelab] Remove legacy devicelab manifest logic (#101554)
This commit is contained in:
@@ -7,7 +7,6 @@ import 'dart:io';
|
||||
|
||||
import 'package:args/args.dart';
|
||||
import 'package:flutter_devicelab/framework/ab.dart';
|
||||
import 'package:flutter_devicelab/framework/manifest.dart';
|
||||
import 'package:flutter_devicelab/framework/runner.dart';
|
||||
import 'package:flutter_devicelab/framework/task_result.dart';
|
||||
import 'package:flutter_devicelab/framework/utils.dart';
|
||||
@@ -63,16 +62,6 @@ Future<void> main(List<String> rawArgs) async {
|
||||
/// Path to write test results to.
|
||||
final String? resultsPath = args['results-file'] as String?;
|
||||
|
||||
if (!args.wasParsed('task')) {
|
||||
if (args.wasParsed('stage') || args.wasParsed('all')) {
|
||||
addTasks(
|
||||
tasks: loadTaskManifest().tasks,
|
||||
args: args,
|
||||
taskNames: taskNames,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
if (args.wasParsed('list')) {
|
||||
for (int i = 0; i < taskNames.length; i++) {
|
||||
print('${(i + 1).toString().padLeft(3)} - ${taskNames[i]}');
|
||||
@@ -209,29 +198,6 @@ File _uniqueFile(String filenameTemplate) {
|
||||
return file;
|
||||
}
|
||||
|
||||
void addTasks({
|
||||
required List<ManifestTask> tasks,
|
||||
required ArgResults args,
|
||||
required List<String> taskNames,
|
||||
}) {
|
||||
if (args.wasParsed('continue-from')) {
|
||||
final int index = tasks.indexWhere((ManifestTask task) => task.name == args['continue-from']);
|
||||
if (index == -1) {
|
||||
throw Exception('Invalid task name "${args['continue-from']}"');
|
||||
}
|
||||
tasks.removeRange(0, index);
|
||||
}
|
||||
// Only start skipping if user specified a task to continue from
|
||||
final String stage = args['stage'] as String;
|
||||
for (final ManifestTask task in tasks) {
|
||||
final bool isQualifyingStage = stage == null || task.stage == stage;
|
||||
final bool isQualifyingHost = !(args['match-host-platform'] as bool) || task.isSupportedByHost();
|
||||
if (isQualifyingHost && isQualifyingStage) {
|
||||
taskNames.add(task.name);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ArgParser createArgParser(List<String> taskNames) {
|
||||
return ArgParser()
|
||||
..addMultiOption(
|
||||
@@ -293,16 +259,6 @@ ArgParser createArgParser(List<String> taskNames) {
|
||||
'The filename may contain a single # character to be replaced by a sequence\n'
|
||||
'number if the name already exists.',
|
||||
)
|
||||
..addFlag(
|
||||
'all',
|
||||
abbr: 'a',
|
||||
help: 'Runs all tasks defined in manifest.yaml in alphabetical order.',
|
||||
)
|
||||
..addOption(
|
||||
'continue-from',
|
||||
abbr: 'c',
|
||||
help: 'With --all or --stage, continue from the given test.',
|
||||
)
|
||||
..addFlag(
|
||||
'exit',
|
||||
defaultsTo: true,
|
||||
@@ -352,12 +308,6 @@ ArgParser createArgParser(List<String> taskNames) {
|
||||
'service-account-token-file',
|
||||
help: '[Flutter infrastructure] Authentication for uploading results.',
|
||||
)
|
||||
..addOption(
|
||||
'stage',
|
||||
abbr: 's',
|
||||
help: 'Name of the stage. Runs all tasks for that stage. The tasks and\n'
|
||||
'their stages are read from manifest.yaml.',
|
||||
)
|
||||
..addFlag(
|
||||
'silent',
|
||||
help: 'Reduce verbosity slightly.',
|
||||
|
||||
Reference in New Issue
Block a user