Bug 1434729 - Make it possible to overwrite 'optimization' in tests transforms. r=dustin

This commit is contained in:
Marco Castelluccio
2018-02-20 19:26:32 +01:00
parent 7b15bfdefc
commit 77d2690173
3 changed files with 36 additions and 21 deletions

View File

@@ -17,12 +17,17 @@ import time
from copy import deepcopy
from mozbuild.util import memoize
from mozbuild import schedules
from taskgraph.util.attributes import TRUNK_PROJECTS
from taskgraph.util.hash import hash_path
from taskgraph.util.treeherder import split_symbol
from taskgraph.transforms.base import TransformSequence
from taskgraph.util.schema import validate_schema, Schema, optionally_keyed_by, resolve_keyed_by
from taskgraph.util.schema import (
validate_schema,
Schema,
optionally_keyed_by,
resolve_keyed_by,
OptimizationSchema,
)
from taskgraph.util.scriptworker import (
BALROG_ACTIONS,
get_balrog_action_scope,
@@ -231,24 +236,7 @@ task_description_schema = Schema({
# Optimization to perform on this task during the optimization phase.
# Optimizations are defined in taskcluster/taskgraph/optimize.py.
Required('optimization'): Any(
# always run this task (default)
None,
# search the index for the given index namespaces, and replace this task if found
# the search occurs in order, with the first match winning
{'index-search': [basestring]},
# consult SETA and skip this task if it is low-value
{'seta': None},
# skip this task if none of the given file patterns match
{'skip-unless-changed': [basestring]},
# skip this task if unless the change files' SCHEDULES contains any of these components
{'skip-unless-schedules': list(schedules.ALL_COMPONENTS)},
# skip if SETA or skip-unless-schedules says to
{'skip-unless-schedules-or-seta': list(schedules.ALL_COMPONENTS)},
# only run this task if its dependencies will run (useful for follow-on tasks that
# are unnecessary if the parent tasks are not run)
{'only-if-dependencies-run': None}
),
Required('optimization'): OptimizationSchema,
# the provisioner-id/worker-type for the task. The following parameters will
# be substituted in this string: