Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
Restore the -e10s suffix (because some day we will have them!)
Reverses the effects of bug 1541527. Thunderbird builds are all single
process.
"""
for job in jobs:
test = job['run']['test']
e10s = test['e10s']
if not e10s: # test-name & friends end with '-1proc'
test['test-name'] = _remove_suffix(test['test-name'], '-1proc')
test['try-name'] = _remove_suffix(test['try-name'], '-1proc')
group, symbol = split_symbol(test['treeherder-symbol'])
if group != '?':
group = _remove_suffix(group, '-1proc')
test['treeherder-symbol'] = join_symbol(group, symbol)
job['label'] = job['label'].replace('-1proc', '')
job['name'] = _remove_suffix(job['name'], '-1proc')
job['treeherder']['symbol'] = test['treeherder-symbol']
else: # e10s in the future
test['test-name'] = add_suffix(test['test-name'], '-e10s')
test['try-name'] = add_suffix(test['try-name'], '-e10s')
group, symbol = split_symbol(test['treeherder-symbol'])
if group != '?':
group = add_suffix(group, '-e10s')
test['treeherder-symbol'] = join_symbol(group, symbol)
job['label'] += '-e10s'
job['name'] = add_suffix(job['name'], '-e10s')
job['treeherder']['symbol'] = test['treeherder-symbol']
test['try-name'] = _remove_suffix(test['try-name'], '-1proc')
group, symbol = split_symbol(test['treeherder-symbol'])
if group != '?':
group = _remove_suffix(group, '-1proc')
test['treeherder-symbol'] = join_symbol(group, symbol)
job['label'] = job['label'].replace('-1proc', '')
job['name'] = _remove_suffix(job['name'], '-1proc')
job['treeherder']['symbol'] = test['treeherder-symbol']
else: # e10s in the future
test['test-name'] = add_suffix(test['test-name'], '-e10s')
test['try-name'] = add_suffix(test['try-name'], '-e10s')
group, symbol = split_symbol(test['treeherder-symbol'])
if group != '?':
group = add_suffix(group, '-e10s')
test['treeherder-symbol'] = join_symbol(group, symbol)
job['label'] += '-e10s'
job['name'] = add_suffix(job['name'], '-e10s')
job['treeherder']['symbol'] = test['treeherder-symbol']
yield job
def build_treeherder_definition(config, tasks):
for task in tasks:
dep = task.pop("primary-dependency")
task.setdefault("treeherder", {}).update(inherit_treeherder_from_dep(task, dep))
job_group = dep.task["extra"]["treeherder"].get("groupSymbol", "?")
job_symbol = task["treeherder"].pop("job-symbol")
full_symbol = join_symbol(job_group, job_symbol)
task["treeherder"]["symbol"] = full_symbol
yield task