Bug 1345863: set the job_try_name for all tasks governed by -j; r=gps

We have a `unittest_try_name` for all unit test tasks, and similarly a
`talos_try_name`. The `-j` flag controls tasks known as "jobs" (although the
word has dozens of other meanings, too). Some of those set `job_try_name`, but
others do not and have special-case support in `try_option_syntax.py`. With
this change, all "jobs" set `job_try_name` and the special-case is removed.

MozReview-Commit-ID: 9hvW7wBIl2B

--HG--
extra : rebase_source : 120b5e9e7aa8f81fe49e72f4dadafdbd145ac357
This commit is contained in:
Dustin J. Mitchell 2017-04-28 11:12:31 -04:00
Родитель a54ca523c9
Коммит a3a9e7939f
7 изменённых файлов: 36 добавлений и 44 удалений

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

@ -9,15 +9,13 @@
loader: taskgraph.loader.transform:loader
transforms:
- taskgraph.transforms.try_job:transforms
- taskgraph.transforms.android_stuff:transforms
- taskgraph.transforms.task:transforms
jobs:
android-api-15-gradle-dependencies:
description: "Android armv7 API 15+ gradle dependencies"
attributes:
build_platform: android-api-15-gradle-dependencies
build_type: opt
index:
product: mobile
job-name: android-api-15-gradle-dependencies-opt
@ -66,9 +64,6 @@ jobs:
android-test:
description: "Android armv7 unit tests"
attributes:
build_platform: android-test
build_type: opt
treeherder:
platform: android-4-0-armv7-api15/opt
kind: test
@ -115,9 +110,6 @@ jobs:
android-lint:
description: "Android lint"
attributes:
build_platform: android-lint
build_type: opt
treeherder:
platform: android-4-0-armv7-api15/opt
kind: test
@ -186,9 +178,6 @@ jobs:
android-checkstyle:
description: "Android checkstyle"
attributes:
build_platform: android-checkstyle
build_type: opt
treeherder:
platform: android-4-0-armv7-api15/opt
kind: test
@ -238,9 +227,6 @@ jobs:
android-findbugs:
description: "Android findbugs"
attributes:
build_platform: android-findbugs
build_type: opt
treeherder:
platform: android-4-0-armv7-api15/opt
kind: test

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

@ -5,7 +5,7 @@
loader: taskgraph.loader.transform:loader
transforms:
- taskgraph.transforms.build_attrs:transforms
- taskgraph.transforms.try_job:transforms
- taskgraph.transforms.job:transforms
- taskgraph.transforms.task:transforms

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

@ -2,7 +2,7 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
linux64-clang/opt:
linux64-clang:
description: "Clang toolchain build"
treeherder:
kind: build
@ -22,7 +22,7 @@ linux64-clang/opt:
- 'build/build-clang/**'
- 'taskcluster/scripts/misc/tooltool-download.sh'
linux64-clang-tidy/opt:
linux64-clang-tidy:
description: "Clang-tidy build"
index:
product: static-analysis
@ -46,7 +46,7 @@ linux64-clang-tidy/opt:
- 'build/build-clang/**'
- 'taskcluster/scripts/misc/tooltool-download.sh'
linux64-gcc/opt:
linux64-gcc:
description: "GCC toolchain build"
treeherder:
kind: build
@ -64,7 +64,7 @@ linux64-gcc/opt:
resources:
- 'build/unix/build-gcc/**'
linux64-binutils/opt:
linux64-binutils:
description: "Binutils toolchain build"
treeherder:
kind: build
@ -82,7 +82,7 @@ linux64-binutils/opt:
resources:
- 'build/unix/build-binutils/**'
linux64-cctools-port/opt:
linux64-cctools-port:
description: "cctools-port toolchain build"
treeherder:
kind: build
@ -101,7 +101,7 @@ linux64-cctools-port/opt:
resources:
- 'taskcluster/scripts/misc/tooltool-download.sh'
linux64-hfsplus/opt:
linux64-hfsplus:
description: "hfsplus toolchain build"
treeherder:
kind: build
@ -121,7 +121,7 @@ linux64-hfsplus/opt:
- 'build/unix/build-hfsplus/**'
- 'taskcluster/scripts/misc/tooltool-download.sh'
linux64-libdmg/opt:
linux64-libdmg:
description: "libdmg-hfsplus toolchain build"
treeherder:
kind: build

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

@ -2,7 +2,7 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
macosx64-clang/opt:
macosx64-clang:
description: "Clang toolchain build"
treeherder:
kind: build
@ -22,7 +22,7 @@ macosx64-clang/opt:
- 'build/build-clang/**'
- 'taskcluster/scripts/misc/tooltool-download.sh'
macosx64-clang-tidy/opt:
macosx64-clang-tidy:
description: "Clang-tidy build"
index:
product: static-analysis
@ -46,7 +46,7 @@ macosx64-clang-tidy/opt:
- 'build/build-clang/**'
- 'taskcluster/scripts/misc/tooltool-download.sh'
macosx64-cctools-port/opt:
macosx64-cctools-port:
description: "cctools-port toolchain build"
treeherder:
kind: build

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

@ -2,7 +2,7 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
win32-clang-cl/opt:
win32-clang-cl:
description: "Clang-cl toolchain build"
treeherder:
kind: build
@ -20,7 +20,7 @@ win32-clang-cl/opt:
- 'build/build-clang/**'
- 'taskcluster/scripts/misc/build-clang-windows-helper32.sh'
win64-clang-cl/opt:
win64-clang-cl:
description: "Clang-cl toolchain build"
treeherder:
kind: build
@ -38,7 +38,7 @@ win64-clang-cl/opt:
- 'build/build-clang/**'
- 'taskcluster/scripts/misc/build-clang-windows-helper64.sh'
win32-clang-tidy/opt:
win32-clang-tidy:
description: "Clang-tidy toolchain build"
index:
product: static-analysis
@ -59,7 +59,7 @@ win32-clang-tidy/opt:
- 'build/build-clang/**'
- 'taskcluster/scripts/misc/build-clang-windows-helper32.sh'
win64-clang-tidy/opt:
win64-clang-tidy:
description: "Clang-tidy toolchain build"
index:
product: static-analysis

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

@ -0,0 +1,19 @@
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from __future__ import absolute_import, print_function, unicode_literals
from taskgraph.transforms.base import TransformSequence
transforms = TransformSequence()
@transforms.add
def set_job_try_name(config, jobs):
"""
For a task which is governed by `-j` in try syntax, set the `job_try_name`
attribute based on the job name.
"""
for job in jobs:
job.setdefault('attributes', {}).setdefault('job_try_name', job['name'])
yield job

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

@ -32,12 +32,6 @@ BUILD_KINDS = set([
'spidermonkey',
])
# anything in this list is governed by -j, matching against the `build_platform` attribute
JOB_KINDS_MATCHING_BUILD_PLATFORM = set([
'toolchain',
'android-stuff',
])
# mapping from shortcut name (usable with -u) to a boolean function identifying
# matching test names
@ -595,16 +589,9 @@ class TryOptionSyntax(object):
if self.jobs is None or job_try_name in self.jobs:
if self.platforms is None or attr('build_platform') not in self.platforms:
return True
if attr('kind') == 'test':
elif attr('kind') == 'test':
return match_test(self.unittests, 'unittest_try_name') \
or match_test(self.talos, 'talos_try_name')
elif attr('kind') in JOB_KINDS_MATCHING_BUILD_PLATFORM:
# This will add 'job' tasks to the target set even if no try syntax was specified.
if not self.jobs:
return True
if attr('build_platform') in self.jobs:
return True
elif attr('kind') in BUILD_KINDS:
if attr('build_type') not in self.build_types:
return False