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:
Dustin J. Mitchell
2017-08-01 20:02:59 +00:00
parent 76d985fb87
commit 18da9b3836
11 changed files with 118 additions and 100 deletions

View File

@@ -888,7 +888,6 @@ def make_job_description(config, tests):
jobdesc['name'] = name
jobdesc['label'] = label
jobdesc['description'] = test['description']
jobdesc['when'] = test.get('when', {})
jobdesc['attributes'] = attributes
jobdesc['dependencies'] = {'build': build_label}
@@ -918,9 +917,11 @@ def make_job_description(config, tests):
}
# run SETA unless this is a try push
jobdesc['optimizations'] = optimizations = []
if config.params['project'] != 'try':
optimizations.append(['seta'])
if config.params['project'] == 'try':
jobdesc['when'] = test.get('when', {})
else:
# when SETA is enabled, the 'when' does not apply (optimizations don't mix)
jobdesc['optimization'] = {'seta': None}
run = jobdesc['run'] = {}
run['using'] = 'mozharness-test'