Bug 1383880: allow only one optimization per task; r=ahal
It is not at *all* clear how multiple optimizations for a single task should interact. No simple logical operation is right in all cases, and in fact in most imaginable cases the desired behavior turns out to be independent of all but one of the optimizations. For example, given both `seta` and `skip-unless-files-changed` optimizations, if SETA says to skip a test, it is low value and should be skipped regardless of what files have changed. But if SETA says to run a test, then it has likely been skipped in previous pushes, so it should be run regardless of what has changed in this push. This also adds a bit more output about optimization, that may be useful for anyone wondering why a particular job didn't run. MozReview-Commit-ID: 3OsvRnWjai4
This commit is contained in:
@@ -13,7 +13,7 @@ class Task(object):
|
||||
- label; the label for this task
|
||||
- attributes: a dictionary of attributes for this task (used for filtering)
|
||||
- task: the task definition (JSON-able dictionary)
|
||||
- optimizations: optimizations to apply to the task (see taskgraph.optimize)
|
||||
- optimization: optimization to apply to the task (see taskgraph.optimize)
|
||||
- dependencies: tasks this one depends on, in the form {name: label}, for example
|
||||
{'build': 'build-linux64/opt', 'docker-image': 'build-docker-image-desktop-test'}
|
||||
|
||||
@@ -26,7 +26,7 @@ class Task(object):
|
||||
display, comparison, serialization, etc. It has no functionality of its own.
|
||||
"""
|
||||
def __init__(self, kind, label, attributes, task,
|
||||
optimizations=None, dependencies=None):
|
||||
optimization=None, dependencies=None):
|
||||
self.kind = kind
|
||||
self.label = label
|
||||
self.attributes = attributes
|
||||
@@ -37,7 +37,7 @@ class Task(object):
|
||||
|
||||
self.attributes['kind'] = kind
|
||||
|
||||
self.optimizations = optimizations or []
|
||||
self.optimization = optimization
|
||||
self.dependencies = dependencies or {}
|
||||
|
||||
def __eq__(self, other):
|
||||
@@ -46,12 +46,12 @@ class Task(object):
|
||||
self.attributes == other.attributes and \
|
||||
self.task == other.task and \
|
||||
self.task_id == other.task_id and \
|
||||
self.optimizations == other.optimizations and \
|
||||
self.optimization == other.optimization and \
|
||||
self.dependencies == other.dependencies
|
||||
|
||||
def __repr__(self):
|
||||
return ('Task({kind!r}, {label!r}, {attributes!r}, {task!r}, '
|
||||
'optimizations={optimizations!r}, '
|
||||
'optimization={optimization!r}, '
|
||||
'dependencies={dependencies!r})'.format(**self.__dict__))
|
||||
|
||||
def to_json(self):
|
||||
@@ -60,7 +60,7 @@ class Task(object):
|
||||
'label': self.label,
|
||||
'attributes': self.attributes,
|
||||
'dependencies': self.dependencies,
|
||||
'optimizations': self.optimizations,
|
||||
'optimization': self.optimization,
|
||||
'task': self.task,
|
||||
}
|
||||
if self.task_id:
|
||||
@@ -79,7 +79,7 @@ class Task(object):
|
||||
label=task_dict['label'],
|
||||
attributes=task_dict['attributes'],
|
||||
task=task_dict['task'],
|
||||
optimizations=task_dict['optimizations'],
|
||||
optimization=task_dict['optimization'],
|
||||
dependencies=task_dict.get('dependencies'))
|
||||
if 'task_id' in task_dict:
|
||||
rv.task_id = task_dict['task_id']
|
||||
|
||||
Reference in New Issue
Block a user