Bug 1340564: filter for android tasks using the build_platform attribute; r=jlorenzo

This avoids using substring matching on labels, which is likely to lead to
sadness someday.

MozReview-Commit-ID: J1pFuP1U335

--HG--
extra : source : 45d01b30e9d1eb6e7a06eb2800d7d54d302c2f6e
This commit is contained in:
Dustin J. Mitchell 2017-04-25 21:59:42 +00:00
Родитель 3c508e3d49
Коммит a242245737
2 изменённых файлов: 9 добавлений и 11 удалений

Просмотреть файл

@ -26,7 +26,8 @@ def get_dependent_loaded_tasks(config, loaded_tasks):
task for task in nightly_tasks if task.kind in config.get('kind-dependencies')
)
android_tasks = [
task for task in tasks_with_matching_kind if 'android' in task.label
task for task in tasks_with_matching_kind
if task.attributes.get('build_platform', '').startswith('android')
]
return android_tasks

Просмотреть файл

@ -9,7 +9,10 @@ import re
from taskgraph.util.schema import validate_schema
REQUIRED_ARCHITECTURES = ('android-x86', 'android-api-15')
REQUIRED_ARCHITECTURES = {
'android-x86-nightly',
'android-api-15-nightly',
}
PLATFORM_REGEX = re.compile(r'signing-android-(\S+)-nightly')
@ -36,15 +39,9 @@ def validate_dependent_tasks_transform(_, jobs):
def check_every_architecture_is_present_in_dependent_tasks(dependent_tasks):
dependencies_labels = [task.label for task in dependent_tasks]
is_this_required_architecture_present = {
architecture: any(architecture in label for label in dependencies_labels)
for architecture in REQUIRED_ARCHITECTURES
}
are_all_required_achitectures_present = all(is_this_required_architecture_present.values())
if not are_all_required_achitectures_present:
dep_platforms = set(t.attributes.get('build_platform') for t in dependent_tasks)
missed_architectures = REQUIRED_ARCHITECTURES - dep_platforms
if missed_architectures:
raise Exception('''One or many required architectures are missing.
Required architectures: {}.