1 # This Source Code Form is subject to the terms of the Mozilla Public
2 # License, v. 2.0. If a copy of the MPL was not distributed with this
3 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 from taskgraph
.util
.taskcluster
import get_task_definition
10 from .registry
import register_callback_action
11 from .util
import create_tasks
, fetch_graph_and_labels
13 logger
= logging
.getLogger(__name__
)
16 @register_callback_action(
17 title
="Raptor Extra Options",
18 name
="raptor-extra-options",
21 "Allows the user to rerun raptor-browsertime tasks with additional arguments."
24 context
=[{"test-type": "raptor"}],
31 "description": "A space-delimited string of extra options "
32 "to be passed into a raptor-browsertime test."
33 "This also works with options with values, where the values "
34 "should be set as an assignment e.g. browser-cycles=3 "
35 "Passing multiple extra options could look something this: "
36 "`verbose browser-cycles=3` where the test runs with verbose "
37 "mode on and the browser cycles only 3 times.",
41 available
=lambda parameters
: True,
43 def raptor_extra_options_action(
44 parameters
, graph_config
, input, task_group_id
, task_id
46 decision_task_id
, full_task_graph
, label_to_taskid
= fetch_graph_and_labels(
47 parameters
, graph_config
49 task
= get_task_definition(task_id
)
50 label
= task
["metadata"]["name"]
53 if task
.label
!= label
:
56 if task
.task
["payload"]["env"].get("PERF_FLAGS"):
57 task
.task
["payload"]["env"]["PERF_FLAGS"] += " " + input.get(
61 task
.task
["payload"]["env"].setdefault(
62 "PERF_FLAGS", input.get("extra_options")
65 task
.task
["extra"]["treeherder"]["symbol"] += "-rxo"
66 task
.task
["extra"]["treeherder"]["groupName"] += " (extra options run)"