From 6bf0a5cb5034a7e684dcc3500e841785237ce2dd Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 19:32:43 +0200 Subject: Adding upstream version 1:115.7.0. Signed-off-by: Daniel Baumann --- .../actions/raptor_extra_options.py | 77 ++++++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 taskcluster/gecko_taskgraph/actions/raptor_extra_options.py (limited to 'taskcluster/gecko_taskgraph/actions/raptor_extra_options.py') diff --git a/taskcluster/gecko_taskgraph/actions/raptor_extra_options.py b/taskcluster/gecko_taskgraph/actions/raptor_extra_options.py new file mode 100644 index 0000000000..43b26d284d --- /dev/null +++ b/taskcluster/gecko_taskgraph/actions/raptor_extra_options.py @@ -0,0 +1,77 @@ +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + + +import logging + +from taskgraph.util.taskcluster import get_task_definition + +from .registry import register_callback_action +from .util import create_tasks, fetch_graph_and_labels + +logger = logging.getLogger(__name__) + + +@register_callback_action( + title="Raptor Extra Options", + name="raptor-extra-options", + symbol="rxo", + description=( + "Allows the user to rerun raptor-browsertime tasks with additional arguments." + ), + order=200, + context=[{"test-type": "raptor"}], + schema={ + "type": "object", + "properties": { + "extra_options": { + "type": "string", + "default": "", + "description": "A space-delimited string of extra options " + "to be passed into a raptor-browsertime test." + "This also works with options with values, where the values " + "should be set as an assignment e.g. browser-cycles=3 " + "Passing multiple extra options could look something this: " + "`verbose browser-cycles=3` where the test runs with verbose " + "mode on and the browser cycles only 3 times.", + } + }, + }, + available=lambda parameters: True, +) +def raptor_extra_options_action( + parameters, graph_config, input, task_group_id, task_id +): + decision_task_id, full_task_graph, label_to_taskid = fetch_graph_and_labels( + parameters, graph_config + ) + task = get_task_definition(task_id) + label = task["metadata"]["name"] + + def modifier(task): + if task.label != label: + return task + + if task.task["payload"]["env"].get("PERF_FLAGS"): + task.task["payload"]["env"]["PERF_FLAGS"] += " " + input.get( + "extra_options" + ) + else: + task.task["payload"]["env"].setdefault( + "PERF_FLAGS", input.get("extra_options") + ) + + task.task["extra"]["treeherder"]["symbol"] += "-rxo" + task.task["extra"]["treeherder"]["groupName"] += " (extra options run)" + return task + + create_tasks( + graph_config, + [label], + full_task_graph, + label_to_taskid, + parameters, + decision_task_id, + modifier=modifier, + ) -- cgit v1.2.3