Bug 1575375 - Allow to key toolchain fetches by platform in source-test tasks. r=nalexander

While here, normalize the use of optionally_keyed_by in source_test.py.

Differential Revision: https://phabricator.services.mozilla.com/D42758

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Mike Hommey 2019-08-21 13:09:02 +00:00
parent bfa5918bf6
commit 36123e2255

View File

@ -16,6 +16,7 @@ from taskgraph.transforms.job import job_description_schema
from taskgraph.util.attributes import keymatch
from taskgraph.util.schema import (
resolve_keyed_by,
optionally_keyed_by,
)
from taskgraph.util.treeherder import join_symbol, split_symbol
@ -45,17 +46,21 @@ source_test_description_schema = Schema({
# These fields can be keyed by "platform", and are otherwise identical to
# job descriptions.
Required('worker-type'): Any(
job_description_schema['worker-type'],
{'by-platform': {basestring: job_description_schema['worker-type']}},
),
Required('worker'): Any(
job_description_schema['worker'],
{'by-platform': {basestring: job_description_schema['worker']}},
),
Required('worker-type'): optionally_keyed_by(
'platform', job_description_schema['worker-type']),
Required('worker'): optionally_keyed_by(
'platform', job_description_schema['worker']),
Optional('python-version'): [int],
# If true, the DECISION_TASK_ID env will be populated.
Optional('require-decision-task-id'): bool,
# A list of artifacts to install from 'fetch' tasks.
Optional('fetches'): {
basestring: optionally_keyed_by(
'platform', job_description_schema['fetches'][basestring]),
},
})
transforms = TransformSequence()
@ -175,6 +180,7 @@ def handle_platform(config, jobs):
try-related attributes.
"""
fields = [
'fetches.toolchain',
'worker-type',
'worker',
]