mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-25 05:41:12 +00:00
Bug 1410513: Move ridealong build configuration to ci/config.yml; r=dustin
MozReview-Commit-ID: 761zWtiZFtz --HG-- extra : rebase_source : 7eb318fcb73b89fe3d8995bbb4f5661239450c87
This commit is contained in:
parent
73e5e1e2b3
commit
2d833ffd8a
@ -52,3 +52,29 @@ treeherder:
|
||||
'p': 'Partial generation'
|
||||
'ps': 'Partials signing'
|
||||
'Rel': 'Release promotion'
|
||||
|
||||
try:
|
||||
# We have a few platforms for which we want to do some "extra" builds, or at
|
||||
# least build-ish things. Sort of. Anyway, these other things are implemented
|
||||
# as different "platforms". These do *not* automatically ride along with "-p
|
||||
# all"
|
||||
ridealong-builds:
|
||||
'android-api-16':
|
||||
- 'android-api-16-l10n'
|
||||
'linux':
|
||||
- 'linux-l10n'
|
||||
'linux64':
|
||||
- 'linux64-l10n'
|
||||
- 'sm-plain'
|
||||
- 'sm-nonunified'
|
||||
- 'sm-arm-sim'
|
||||
- 'sm-arm64-sim'
|
||||
- 'sm-compacting'
|
||||
- 'sm-rootanalysis'
|
||||
- 'sm-package'
|
||||
- 'sm-tsan'
|
||||
- 'sm-asan'
|
||||
- 'sm-mozjs-sys'
|
||||
- 'sm-msan'
|
||||
- 'sm-fuzzing'
|
||||
- 'sm-rust-bindings'
|
||||
|
@ -11,7 +11,14 @@ graph_config_schema = Schema({
|
||||
Required('treeherder'): {
|
||||
# Mapping of treeherder group symbols to descriptive names
|
||||
Required('group-names'): {basestring: basestring}
|
||||
}
|
||||
},
|
||||
Required('try'): {
|
||||
# We have a few platforms for which we want to do some "extra" builds, or at
|
||||
# least build-ish things. Sort of. Anyway, these other things are implemented
|
||||
# as different "platforms". These do *not* automatically ride along with "-p
|
||||
# all"
|
||||
Required('ridealong-builds', default={}): {basestring: [basestring]},
|
||||
},
|
||||
})
|
||||
|
||||
|
||||
|
@ -24,7 +24,7 @@ def filter_task(name):
|
||||
|
||||
|
||||
@filter_task('target_tasks_method')
|
||||
def filter_target_tasks(graph, parameters):
|
||||
def filter_target_tasks(graph, parameters, graph_config):
|
||||
"""Proxy filter to use legacy target tasks code.
|
||||
|
||||
This should go away once target_tasks are converted to filters.
|
||||
@ -32,11 +32,11 @@ def filter_target_tasks(graph, parameters):
|
||||
|
||||
attr = parameters.get('target_tasks_method', 'all_tasks')
|
||||
fn = target_tasks.get_method(attr)
|
||||
return fn(graph, parameters)
|
||||
return fn(graph, parameters, graph_config)
|
||||
|
||||
|
||||
@filter_task('check_servo')
|
||||
def filter_servo(graph, parameters):
|
||||
def filter_servo(graph, parameters, graph_config):
|
||||
"""Filter out tasks for Servo vendoring changesets.
|
||||
|
||||
If the change triggering is related to Servo vendoring, impact is minimal
|
||||
|
@ -258,7 +258,7 @@ class TaskGraphGenerator(object):
|
||||
Graph(set(all_tasks.keys()), set()))
|
||||
for fltr in self.filters:
|
||||
old_len = len(target_task_set.graph.nodes)
|
||||
target_tasks = set(fltr(target_task_set, self.parameters))
|
||||
target_tasks = set(fltr(target_task_set, self.parameters, graph_config))
|
||||
target_task_set = TaskGraph(
|
||||
{l: all_tasks[l] for l in target_tasks},
|
||||
Graph(target_tasks, set()))
|
||||
|
@ -93,15 +93,15 @@ def standard_filter(task, parameters):
|
||||
)
|
||||
|
||||
|
||||
def _try_task_config(full_task_graph, parameters):
|
||||
def _try_task_config(full_task_graph, parameters, graph_config):
|
||||
requested_tasks = parameters['try_task_config']['tasks']
|
||||
return list(set(requested_tasks) & full_task_graph.graph.nodes)
|
||||
|
||||
|
||||
def _try_option_syntax(full_task_graph, parameters):
|
||||
def _try_option_syntax(full_task_graph, parameters, graph_config):
|
||||
"""Generate a list of target tasks based on try syntax in
|
||||
parameters['message'] and, for context, the full task graph."""
|
||||
options = try_option_syntax.TryOptionSyntax(parameters, full_task_graph)
|
||||
options = try_option_syntax.TryOptionSyntax(parameters, full_task_graph, graph_config)
|
||||
target_tasks_labels = [t.label for t in full_task_graph.tasks.itervalues()
|
||||
if options.task_matches(t)]
|
||||
|
||||
@ -147,12 +147,12 @@ def _try_option_syntax(full_task_graph, parameters):
|
||||
|
||||
|
||||
@_target_task('try_tasks')
|
||||
def target_tasks_try(full_task_graph, parameters):
|
||||
def target_tasks_try(full_task_graph, parameters, graph_config):
|
||||
try_mode = parameters['try_mode']
|
||||
if try_mode == 'try_task_config':
|
||||
return _try_task_config(full_task_graph, parameters)
|
||||
return _try_task_config(full_task_graph, parameters, graph_config)
|
||||
elif try_mode == 'try_option_syntax':
|
||||
return _try_option_syntax(full_task_graph, parameters)
|
||||
return _try_option_syntax(full_task_graph, parameters, graph_config)
|
||||
else:
|
||||
# With no try mode, we schedule nothing, allowing the user to add tasks
|
||||
# later via treeherder.
|
||||
@ -160,7 +160,7 @@ def target_tasks_try(full_task_graph, parameters):
|
||||
|
||||
|
||||
@_target_task('default')
|
||||
def target_tasks_default(full_task_graph, parameters):
|
||||
def target_tasks_default(full_task_graph, parameters, graph_config):
|
||||
"""Target the tasks which have indicated they should be run on this project
|
||||
via the `run_on_projects` attributes."""
|
||||
return [l for l, t in full_task_graph.tasks.iteritems()
|
||||
@ -168,7 +168,7 @@ def target_tasks_default(full_task_graph, parameters):
|
||||
|
||||
|
||||
@_target_task('ash_tasks')
|
||||
def target_tasks_ash(full_task_graph, parameters):
|
||||
def target_tasks_ash(full_task_graph, parameters, graph_config):
|
||||
"""Target tasks that only run on the ash branch."""
|
||||
def filter(task):
|
||||
platform = task.attributes.get('build_platform')
|
||||
@ -204,7 +204,7 @@ def target_tasks_ash(full_task_graph, parameters):
|
||||
|
||||
|
||||
@_target_task('cedar_tasks')
|
||||
def target_tasks_cedar(full_task_graph, parameters):
|
||||
def target_tasks_cedar(full_task_graph, parameters, graph_config):
|
||||
"""Target tasks that only run on the cedar branch."""
|
||||
def filter(task):
|
||||
platform = task.attributes.get('build_platform')
|
||||
@ -220,7 +220,7 @@ def target_tasks_cedar(full_task_graph, parameters):
|
||||
|
||||
|
||||
@_target_task('graphics_tasks')
|
||||
def target_tasks_graphics(full_task_graph, parameters):
|
||||
def target_tasks_graphics(full_task_graph, parameters, graph_config):
|
||||
"""In addition to doing the filtering by project that the 'default'
|
||||
filter does, also remove artifact builds because we have csets on
|
||||
the graphics branch that aren't on the candidate branches of artifact
|
||||
@ -235,7 +235,7 @@ def target_tasks_graphics(full_task_graph, parameters):
|
||||
|
||||
|
||||
@_target_task('mochitest_valgrind')
|
||||
def target_tasks_valgrind(full_task_graph, parameters):
|
||||
def target_tasks_valgrind(full_task_graph, parameters, graph_config):
|
||||
"""Target tasks that only run on the cedar branch."""
|
||||
def filter(task):
|
||||
platform = task.attributes.get('test_platform', '').split('/')[0]
|
||||
@ -251,7 +251,7 @@ def target_tasks_valgrind(full_task_graph, parameters):
|
||||
|
||||
|
||||
@_target_task('nightly_fennec')
|
||||
def target_tasks_nightly_fennec(full_task_graph, parameters):
|
||||
def target_tasks_nightly_fennec(full_task_graph, parameters, graph_config):
|
||||
"""Select the set of tasks required for a nightly build of fennec. The
|
||||
nightly build process involves a pipeline of builds, signing,
|
||||
and, eventually, uploading the tasks to balrog."""
|
||||
@ -270,7 +270,7 @@ def target_tasks_nightly_fennec(full_task_graph, parameters):
|
||||
|
||||
|
||||
@_target_task('nightly_linux')
|
||||
def target_tasks_nightly_linux(full_task_graph, parameters):
|
||||
def target_tasks_nightly_linux(full_task_graph, parameters, graph_config):
|
||||
"""Select the set of tasks required for a nightly build of linux. The
|
||||
nightly build process involves a pipeline of builds, signing,
|
||||
and, eventually, uploading the tasks to balrog."""
|
||||
@ -282,7 +282,7 @@ def target_tasks_nightly_linux(full_task_graph, parameters):
|
||||
|
||||
|
||||
@_target_task('mozilla_beta_tasks')
|
||||
def target_tasks_mozilla_beta(full_task_graph, parameters):
|
||||
def target_tasks_mozilla_beta(full_task_graph, parameters, graph_config):
|
||||
"""Select the set of tasks required for a promotable beta or release build
|
||||
of desktop, plus android CI. The candidates build process involves a pipeline
|
||||
of builds and signing, but does not include beetmover or balrog jobs."""
|
||||
@ -292,7 +292,7 @@ def target_tasks_mozilla_beta(full_task_graph, parameters):
|
||||
|
||||
|
||||
@_target_task('mozilla_release_tasks')
|
||||
def target_tasks_mozilla_release(full_task_graph, parameters):
|
||||
def target_tasks_mozilla_release(full_task_graph, parameters, graph_config):
|
||||
"""Select the set of tasks required for a promotable beta or release build
|
||||
of desktop, plus android CI. The candidates build process involves a pipeline
|
||||
of builds and signing, but does not include beetmover or balrog jobs."""
|
||||
@ -304,7 +304,7 @@ def target_tasks_mozilla_release(full_task_graph, parameters):
|
||||
@_target_task('maple_desktop_promotion')
|
||||
@_target_task('mozilla-beta_desktop_promotion')
|
||||
@_target_task('mozilla-release_desktop_promotion')
|
||||
def target_tasks_mozilla_beta_desktop_promotion(full_task_graph, parameters):
|
||||
def target_tasks_mozilla_beta_desktop_promotion(full_task_graph, parameters, graph_config):
|
||||
"""Select the superset of tasks required to promote a beta or release build
|
||||
of desktop. This should include all non-android mozilla_beta tasks, plus
|
||||
l10n, beetmover, balrog, etc."""
|
||||
@ -349,7 +349,7 @@ def target_tasks_mozilla_beta_desktop_promotion(full_task_graph, parameters):
|
||||
|
||||
|
||||
@_target_task('publish_firefox')
|
||||
def target_tasks_publish_firefox(full_task_graph, parameters):
|
||||
def target_tasks_publish_firefox(full_task_graph, parameters, graph_config):
|
||||
"""Select the set of tasks required to publish a candidates build of firefox.
|
||||
Previous build deps will be optimized out via action task."""
|
||||
filtered_for_candidates = target_tasks_mozilla_beta_desktop_promotion(
|
||||
@ -375,7 +375,7 @@ def target_tasks_publish_firefox(full_task_graph, parameters):
|
||||
|
||||
|
||||
@_target_task('candidates_fennec')
|
||||
def target_tasks_candidates_fennec(full_task_graph, parameters):
|
||||
def target_tasks_candidates_fennec(full_task_graph, parameters, graph_config):
|
||||
"""Select the set of tasks required for a candidates build of fennec. The
|
||||
nightly build process involves a pipeline of builds, signing,
|
||||
and, eventually, uploading the tasks to balrog."""
|
||||
@ -403,7 +403,7 @@ def target_tasks_candidates_fennec(full_task_graph, parameters):
|
||||
|
||||
|
||||
@_target_task('publish_fennec')
|
||||
def target_tasks_publish_fennec(full_task_graph, parameters):
|
||||
def target_tasks_publish_fennec(full_task_graph, parameters, graph_config):
|
||||
"""Select the set of tasks required to publish a candidates build of fennec.
|
||||
Previous build deps will be optimized out via action task."""
|
||||
filtered_for_candidates = target_tasks_candidates_fennec(full_task_graph, parameters)
|
||||
@ -435,7 +435,7 @@ def target_tasks_publish_fennec(full_task_graph, parameters):
|
||||
|
||||
|
||||
@_target_task('pine_tasks')
|
||||
def target_tasks_pine(full_task_graph, parameters):
|
||||
def target_tasks_pine(full_task_graph, parameters, graph_config):
|
||||
"""Bug 1339179 - no mobile automation needed on pine"""
|
||||
def filter(task):
|
||||
platform = task.attributes.get('build_platform')
|
||||
@ -452,7 +452,7 @@ def target_tasks_pine(full_task_graph, parameters):
|
||||
|
||||
|
||||
@_target_task('nightly_macosx')
|
||||
def target_tasks_nightly_macosx(full_task_graph, parameters):
|
||||
def target_tasks_nightly_macosx(full_task_graph, parameters, graph_config):
|
||||
"""Select the set of tasks required for a nightly build of macosx. The
|
||||
nightly build process involves a pipeline of builds, signing,
|
||||
and, eventually, uploading the tasks to balrog."""
|
||||
@ -464,7 +464,7 @@ def target_tasks_nightly_macosx(full_task_graph, parameters):
|
||||
|
||||
|
||||
@_target_task('nightly_win32')
|
||||
def target_tasks_nightly_win32(full_task_graph, parameters):
|
||||
def target_tasks_nightly_win32(full_task_graph, parameters, graph_config):
|
||||
"""Select the set of tasks required for a nightly build of win32 and win64.
|
||||
The nightly build process involves a pipeline of builds, signing,
|
||||
and, eventually, uploading the tasks to balrog."""
|
||||
@ -478,7 +478,7 @@ def target_tasks_nightly_win32(full_task_graph, parameters):
|
||||
|
||||
|
||||
@_target_task('nightly_win64')
|
||||
def target_tasks_nightly_win64(full_task_graph, parameters):
|
||||
def target_tasks_nightly_win64(full_task_graph, parameters, graph_config):
|
||||
"""Select the set of tasks required for a nightly build of win32 and win64.
|
||||
The nightly build process involves a pipeline of builds, signing,
|
||||
and, eventually, uploading the tasks to balrog."""
|
||||
@ -492,7 +492,7 @@ def target_tasks_nightly_win64(full_task_graph, parameters):
|
||||
|
||||
|
||||
@_target_task('nightly_desktop')
|
||||
def target_tasks_nightly_desktop(full_task_graph, parameters):
|
||||
def target_tasks_nightly_desktop(full_task_graph, parameters, graph_config):
|
||||
"""Select the set of tasks required for a nightly build of linux, mac,
|
||||
windows."""
|
||||
# Avoid duplicate tasks.
|
||||
@ -506,7 +506,7 @@ def target_tasks_nightly_desktop(full_task_graph, parameters):
|
||||
|
||||
# Opt DMD builds should only run nightly
|
||||
@_target_task('nightly_dmd')
|
||||
def target_tasks_dmd(full_task_graph, parameters):
|
||||
def target_tasks_dmd(full_task_graph, parameters, graph_config):
|
||||
"""Target DMD that run nightly on the m-c branch."""
|
||||
def filter(task):
|
||||
platform = task.attributes.get('build_platform', '')
|
||||
@ -515,7 +515,7 @@ def target_tasks_dmd(full_task_graph, parameters):
|
||||
|
||||
|
||||
@_target_task('file_update')
|
||||
def target_tasks_file_update(full_task_graph, parameters):
|
||||
def target_tasks_file_update(full_task_graph, parameters, graph_config):
|
||||
"""Select the set of tasks required to perform nightly in-tree file updates
|
||||
"""
|
||||
def filter(task):
|
||||
|
@ -48,14 +48,14 @@ class FakeKind(Kind):
|
||||
|
||||
class WithFakeKind(TaskGraphGenerator):
|
||||
|
||||
def _load_kinds(self):
|
||||
def _load_kinds(self, graph_config):
|
||||
for kind_name, cfg in self.parameters['_kinds']:
|
||||
config = {
|
||||
'transforms': [],
|
||||
}
|
||||
if cfg:
|
||||
config.update(cfg)
|
||||
yield FakeKind(kind_name, '/fake', config)
|
||||
yield FakeKind(kind_name, '/fake', config, graph_config)
|
||||
|
||||
def _load_graph_config(self):
|
||||
return {}
|
||||
@ -91,7 +91,7 @@ class TestGenerator(unittest.TestCase):
|
||||
FakeKind.loaded_kinds = []
|
||||
self.target_tasks = target_tasks or []
|
||||
|
||||
def target_tasks_method(full_task_graph, parameters):
|
||||
def target_tasks_method(full_task_graph, parameters, graph_config):
|
||||
return self.target_tasks
|
||||
|
||||
def make_fake_strategies():
|
||||
|
@ -17,7 +17,7 @@ from mozunit import main
|
||||
|
||||
class FakeTryOptionSyntax(object):
|
||||
|
||||
def __init__(self, message, task_graph):
|
||||
def __init__(self, message, task_graph, graph_config):
|
||||
self.trigger_tests = 0
|
||||
self.talos_trigger_tests = 0
|
||||
self.notifications = None
|
||||
@ -40,7 +40,7 @@ class TestTargetTasks(unittest.TestCase):
|
||||
task={}),
|
||||
}, graph=Graph(nodes={'a'}, edges=set()))
|
||||
parameters = {'project': project}
|
||||
return 'a' in method(graph, parameters)
|
||||
return 'a' in method(graph, parameters, {})
|
||||
|
||||
def test_default_all(self):
|
||||
"""run_on_projects=[all] includes release, integration, and other projects"""
|
||||
@ -94,7 +94,7 @@ class TestTargetTasks(unittest.TestCase):
|
||||
'message': '',
|
||||
}
|
||||
# only runs the task with run_on_projects: try
|
||||
self.assertEqual(method(tg, params), [])
|
||||
self.assertEqual(method(tg, params, {}), [])
|
||||
|
||||
def test_try_option_syntax(self):
|
||||
"try_mode = try_option_syntax uses TryOptionSyntax"
|
||||
@ -105,7 +105,7 @@ class TestTargetTasks(unittest.TestCase):
|
||||
'try_mode': 'try_option_syntax',
|
||||
'message': 'try: -p all',
|
||||
}
|
||||
self.assertEqual(method(tg, params), ['b'])
|
||||
self.assertEqual(method(tg, params, {}), ['b'])
|
||||
|
||||
def test_try_task_config(self):
|
||||
"try_mode = try_task_config uses the try config"
|
||||
@ -115,7 +115,7 @@ class TestTargetTasks(unittest.TestCase):
|
||||
'try_mode': 'try_task_config',
|
||||
'try_task_config': {'tasks': ['a']},
|
||||
}
|
||||
self.assertEqual(method(tg, params), ['a'])
|
||||
self.assertEqual(method(tg, params, {}), ['a'])
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
@ -7,7 +7,6 @@ from __future__ import absolute_import, print_function, unicode_literals
|
||||
import unittest
|
||||
|
||||
from taskgraph.try_option_syntax import TryOptionSyntax, parse_message
|
||||
from taskgraph.try_option_syntax import RIDEALONG_BUILDS
|
||||
from taskgraph.graph import Graph
|
||||
from taskgraph.taskgraph import TaskGraph
|
||||
from taskgraph.task import Task
|
||||
@ -49,6 +48,15 @@ tasks = {k: v for k, v in [
|
||||
talos_task('extra9', 'linux64/psan'),
|
||||
]}
|
||||
|
||||
RIDEALONG_BUILDS = {
|
||||
'linux': ['linux-ridealong'],
|
||||
'linux64': ['linux64-ridealong'],
|
||||
}
|
||||
|
||||
GRAPH_CONFIG = {
|
||||
'try': {'ridealong-builds': RIDEALONG_BUILDS},
|
||||
}
|
||||
|
||||
for r in RIDEALONG_BUILDS.values():
|
||||
tasks.update({k: v for k, v in [
|
||||
unittest_task(n + '-test', n) for n in r
|
||||
@ -66,7 +74,7 @@ class TestTryOptionSyntax(unittest.TestCase):
|
||||
def test_unknown_args(self):
|
||||
"unknown arguments are ignored"
|
||||
parameters = {'try_options': parse_message('try: --doubledash -z extra')}
|
||||
tos = TryOptionSyntax(parameters, graph_with_jobs)
|
||||
tos = TryOptionSyntax(parameters, graph_with_jobs, GRAPH_CONFIG)
|
||||
# equilvant to "try:"..
|
||||
self.assertEqual(tos.build_types, [])
|
||||
self.assertEqual(tos.jobs, [])
|
||||
@ -74,85 +82,85 @@ class TestTryOptionSyntax(unittest.TestCase):
|
||||
def test_apostrophe_in_message(self):
|
||||
"apostrophe does not break parsing"
|
||||
parameters = {'try_options': parse_message('Increase spammy log\'s log level. try: -b do')}
|
||||
tos = TryOptionSyntax(parameters, graph_with_jobs)
|
||||
tos = TryOptionSyntax(parameters, graph_with_jobs, GRAPH_CONFIG)
|
||||
self.assertEqual(sorted(tos.build_types), ['debug', 'opt'])
|
||||
|
||||
def test_b_do(self):
|
||||
"-b do should produce both build_types"
|
||||
parameters = {'try_options': parse_message('try: -b do')}
|
||||
tos = TryOptionSyntax(parameters, graph_with_jobs)
|
||||
tos = TryOptionSyntax(parameters, graph_with_jobs, GRAPH_CONFIG)
|
||||
self.assertEqual(sorted(tos.build_types), ['debug', 'opt'])
|
||||
|
||||
def test_b_d(self):
|
||||
"-b d should produce build_types=['debug']"
|
||||
parameters = {'try_options': parse_message('try: -b d')}
|
||||
tos = TryOptionSyntax(parameters, graph_with_jobs)
|
||||
tos = TryOptionSyntax(parameters, graph_with_jobs, GRAPH_CONFIG)
|
||||
self.assertEqual(sorted(tos.build_types), ['debug'])
|
||||
|
||||
def test_b_o(self):
|
||||
"-b o should produce build_types=['opt']"
|
||||
parameters = {'try_options': parse_message('try: -b o')}
|
||||
tos = TryOptionSyntax(parameters, graph_with_jobs)
|
||||
tos = TryOptionSyntax(parameters, graph_with_jobs, GRAPH_CONFIG)
|
||||
self.assertEqual(sorted(tos.build_types), ['opt'])
|
||||
|
||||
def test_build_o(self):
|
||||
"--build o should produce build_types=['opt']"
|
||||
parameters = {'try_options': parse_message('try: --build o')}
|
||||
tos = TryOptionSyntax(parameters, graph_with_jobs)
|
||||
tos = TryOptionSyntax(parameters, graph_with_jobs, GRAPH_CONFIG)
|
||||
self.assertEqual(sorted(tos.build_types), ['opt'])
|
||||
|
||||
def test_b_dx(self):
|
||||
"-b dx should produce build_types=['debug'], silently ignoring the x"
|
||||
parameters = {'try_options': parse_message('try: -b dx')}
|
||||
tos = TryOptionSyntax(parameters, graph_with_jobs)
|
||||
tos = TryOptionSyntax(parameters, graph_with_jobs, GRAPH_CONFIG)
|
||||
self.assertEqual(sorted(tos.build_types), ['debug'])
|
||||
|
||||
def test_j_job(self):
|
||||
"-j somejob sets jobs=['somejob']"
|
||||
parameters = {'try_options': parse_message('try: -j somejob')}
|
||||
tos = TryOptionSyntax(parameters, graph_with_jobs)
|
||||
tos = TryOptionSyntax(parameters, graph_with_jobs, GRAPH_CONFIG)
|
||||
self.assertEqual(sorted(tos.jobs), ['somejob'])
|
||||
|
||||
def test_j_jobs(self):
|
||||
"-j job1,job2 sets jobs=['job1', 'job2']"
|
||||
parameters = {'try_options': parse_message('try: -j job1,job2')}
|
||||
tos = TryOptionSyntax(parameters, graph_with_jobs)
|
||||
tos = TryOptionSyntax(parameters, graph_with_jobs, GRAPH_CONFIG)
|
||||
self.assertEqual(sorted(tos.jobs), ['job1', 'job2'])
|
||||
|
||||
def test_j_all(self):
|
||||
"-j all sets jobs=None"
|
||||
parameters = {'try_options': parse_message('try: -j all')}
|
||||
tos = TryOptionSyntax(parameters, graph_with_jobs)
|
||||
tos = TryOptionSyntax(parameters, graph_with_jobs, GRAPH_CONFIG)
|
||||
self.assertEqual(tos.jobs, None)
|
||||
|
||||
def test_j_twice(self):
|
||||
"-j job1 -j job2 sets jobs=job1, job2"
|
||||
parameters = {'try_options': parse_message('try: -j job1 -j job2')}
|
||||
tos = TryOptionSyntax(parameters, graph_with_jobs)
|
||||
tos = TryOptionSyntax(parameters, graph_with_jobs, GRAPH_CONFIG)
|
||||
self.assertEqual(sorted(tos.jobs), sorted(['job1', 'job2']))
|
||||
|
||||
def test_p_all(self):
|
||||
"-p all sets platforms=None"
|
||||
parameters = {'try_options': parse_message('try: -p all')}
|
||||
tos = TryOptionSyntax(parameters, graph_with_jobs)
|
||||
tos = TryOptionSyntax(parameters, graph_with_jobs, GRAPH_CONFIG)
|
||||
self.assertEqual(tos.platforms, None)
|
||||
|
||||
def test_p_linux(self):
|
||||
"-p linux sets platforms=['linux', 'linux-l10n']"
|
||||
"-p linux sets platforms=['linux', 'linux-ridealong']"
|
||||
parameters = {'try_options': parse_message('try: -p linux')}
|
||||
tos = TryOptionSyntax(parameters, graph_with_jobs)
|
||||
self.assertEqual(tos.platforms, ['linux', 'linux-l10n'])
|
||||
tos = TryOptionSyntax(parameters, graph_with_jobs, GRAPH_CONFIG)
|
||||
self.assertEqual(tos.platforms, ['linux', 'linux-ridealong'])
|
||||
|
||||
def test_p_linux_win32(self):
|
||||
"-p linux,win32 sets platforms=['linux', 'linux-l10n', 'win32']"
|
||||
"-p linux,win32 sets platforms=['linux', 'linux-ridealong', 'win32']"
|
||||
parameters = {'try_options': parse_message('try: -p linux,win32')}
|
||||
tos = TryOptionSyntax(parameters, graph_with_jobs)
|
||||
self.assertEqual(sorted(tos.platforms), ['linux', 'linux-l10n', 'win32'])
|
||||
tos = TryOptionSyntax(parameters, graph_with_jobs, GRAPH_CONFIG)
|
||||
self.assertEqual(sorted(tos.platforms), ['linux', 'linux-ridealong', 'win32'])
|
||||
|
||||
def test_p_expands_ridealongs(self):
|
||||
"-p linux,linux64 includes the RIDEALONG_BUILDS"
|
||||
parameters = {'try_options': parse_message('try: -p linux,linux64')}
|
||||
tos = TryOptionSyntax(parameters, graph_with_jobs)
|
||||
tos = TryOptionSyntax(parameters, graph_with_jobs, GRAPH_CONFIG)
|
||||
platforms = set(['linux'] + RIDEALONG_BUILDS['linux'])
|
||||
platforms |= set(['linux64'] + RIDEALONG_BUILDS['linux64'])
|
||||
self.assertEqual(sorted(tos.platforms), sorted(platforms))
|
||||
@ -160,31 +168,31 @@ class TestTryOptionSyntax(unittest.TestCase):
|
||||
def test_u_none(self):
|
||||
"-u none sets unittests=[]"
|
||||
parameters = {'try_options': parse_message('try: -u none')}
|
||||
tos = TryOptionSyntax(parameters, graph_with_jobs)
|
||||
tos = TryOptionSyntax(parameters, graph_with_jobs, GRAPH_CONFIG)
|
||||
self.assertEqual(sorted(tos.unittests), [])
|
||||
|
||||
def test_u_all(self):
|
||||
"-u all sets unittests=[..whole list..]"
|
||||
parameters = {'try_options': parse_message('try: -u all')}
|
||||
tos = TryOptionSyntax(parameters, graph_with_jobs)
|
||||
tos = TryOptionSyntax(parameters, graph_with_jobs, GRAPH_CONFIG)
|
||||
self.assertEqual(sorted(tos.unittests), sorted([{'test': t} for t in unittest_tasks]))
|
||||
|
||||
def test_u_single(self):
|
||||
"-u mochitest-webgl sets unittests=[mochitest-webgl]"
|
||||
parameters = {'try_options': parse_message('try: -u mochitest-webgl')}
|
||||
tos = TryOptionSyntax(parameters, graph_with_jobs)
|
||||
tos = TryOptionSyntax(parameters, graph_with_jobs, GRAPH_CONFIG)
|
||||
self.assertEqual(sorted(tos.unittests), sorted([{'test': 'mochitest-webgl'}]))
|
||||
|
||||
def test_u_alias(self):
|
||||
"-u mochitest-gl sets unittests=[mochitest-webgl]"
|
||||
parameters = {'try_options': parse_message('try: -u mochitest-gl')}
|
||||
tos = TryOptionSyntax(parameters, graph_with_jobs)
|
||||
tos = TryOptionSyntax(parameters, graph_with_jobs, GRAPH_CONFIG)
|
||||
self.assertEqual(sorted(tos.unittests), sorted([{'test': 'mochitest-webgl'}]))
|
||||
|
||||
def test_u_multi_alias(self):
|
||||
"-u e10s sets unittests=[all e10s unittests]"
|
||||
parameters = {'try_options': parse_message('try: -u e10s')}
|
||||
tos = TryOptionSyntax(parameters, graph_with_jobs)
|
||||
tos = TryOptionSyntax(parameters, graph_with_jobs, GRAPH_CONFIG)
|
||||
self.assertEqual(sorted(tos.unittests), sorted([
|
||||
{'test': t} for t in unittest_tasks if 'e10s' in t
|
||||
]))
|
||||
@ -192,7 +200,7 @@ class TestTryOptionSyntax(unittest.TestCase):
|
||||
def test_u_commas(self):
|
||||
"-u mochitest-webgl,gtest sets unittests=both"
|
||||
parameters = {'try_options': parse_message('try: -u mochitest-webgl,gtest')}
|
||||
tos = TryOptionSyntax(parameters, graph_with_jobs)
|
||||
tos = TryOptionSyntax(parameters, graph_with_jobs, GRAPH_CONFIG)
|
||||
self.assertEqual(sorted(tos.unittests), sorted([
|
||||
{'test': 'mochitest-webgl'},
|
||||
{'test': 'gtest'},
|
||||
@ -201,7 +209,7 @@ class TestTryOptionSyntax(unittest.TestCase):
|
||||
def test_u_chunks(self):
|
||||
"-u gtest-3,gtest-4 selects the third and fourth chunk of gtest"
|
||||
parameters = {'try_options': parse_message('try: -u gtest-3,gtest-4')}
|
||||
tos = TryOptionSyntax(parameters, graph_with_jobs)
|
||||
tos = TryOptionSyntax(parameters, graph_with_jobs, GRAPH_CONFIG)
|
||||
self.assertEqual(sorted(tos.unittests), sorted([
|
||||
{'test': 'gtest', 'only_chunks': set('34')},
|
||||
]))
|
||||
@ -209,7 +217,7 @@ class TestTryOptionSyntax(unittest.TestCase):
|
||||
def test_u_platform(self):
|
||||
"-u gtest[linux] selects the linux platform for gtest"
|
||||
parameters = {'try_options': parse_message('try: -u gtest[linux]')}
|
||||
tos = TryOptionSyntax(parameters, graph_with_jobs)
|
||||
tos = TryOptionSyntax(parameters, graph_with_jobs, GRAPH_CONFIG)
|
||||
self.assertEqual(sorted(tos.unittests), sorted([
|
||||
{'test': 'gtest', 'platforms': ['linux']},
|
||||
]))
|
||||
@ -217,7 +225,7 @@ class TestTryOptionSyntax(unittest.TestCase):
|
||||
def test_u_platforms(self):
|
||||
"-u gtest[linux,win32] selects the linux and win32 platforms for gtest"
|
||||
parameters = {'try_options': parse_message('try: -u gtest[linux,win32]')}
|
||||
tos = TryOptionSyntax(parameters, graph_with_jobs)
|
||||
tos = TryOptionSyntax(parameters, graph_with_jobs, GRAPH_CONFIG)
|
||||
self.assertEqual(sorted(tos.unittests), sorted([
|
||||
{'test': 'gtest', 'platforms': ['linux', 'win32']},
|
||||
]))
|
||||
@ -226,7 +234,7 @@ class TestTryOptionSyntax(unittest.TestCase):
|
||||
"""-u gtest[Ubuntu] selects the linux, linux64, linux64-asan, linux64-stylo-disabled,
|
||||
and linux64-stylo-sequential platforms for gtest"""
|
||||
parameters = {'try_options': parse_message('try: -u gtest[Ubuntu]')}
|
||||
tos = TryOptionSyntax(parameters, graph_with_jobs)
|
||||
tos = TryOptionSyntax(parameters, graph_with_jobs, GRAPH_CONFIG)
|
||||
self.assertEqual(sorted(tos.unittests), sorted([
|
||||
{'test': 'gtest', 'platforms': ['linux32', 'linux64', 'linux64-asan',
|
||||
'linux64-stylo-disabled', 'linux64-stylo-sequential']},
|
||||
@ -235,7 +243,7 @@ class TestTryOptionSyntax(unittest.TestCase):
|
||||
def test_u_platforms_negated(self):
|
||||
"-u gtest[-linux] selects all platforms but linux for gtest"
|
||||
parameters = {'try_options': parse_message('try: -u gtest[-linux]')}
|
||||
tos = TryOptionSyntax(parameters, graph_with_jobs)
|
||||
tos = TryOptionSyntax(parameters, graph_with_jobs, GRAPH_CONFIG)
|
||||
all_platforms = set([x.attributes['test_platform'] for x in unittest_tasks.values()])
|
||||
self.assertEqual(sorted(tos.unittests[0]['platforms']), sorted(
|
||||
[x for x in all_platforms if x != 'linux']
|
||||
@ -244,7 +252,7 @@ class TestTryOptionSyntax(unittest.TestCase):
|
||||
def test_u_platforms_negated_pretty(self):
|
||||
"-u gtest[Ubuntu,-x64] selects just linux for gtest"
|
||||
parameters = {'try_options': parse_message('try: -u gtest[Ubuntu,-x64]')}
|
||||
tos = TryOptionSyntax(parameters, graph_with_jobs)
|
||||
tos = TryOptionSyntax(parameters, graph_with_jobs, GRAPH_CONFIG)
|
||||
self.assertEqual(sorted(tos.unittests), sorted([
|
||||
{'test': 'gtest', 'platforms': ['linux32']},
|
||||
]))
|
||||
@ -252,7 +260,7 @@ class TestTryOptionSyntax(unittest.TestCase):
|
||||
def test_u_chunks_platforms(self):
|
||||
"-u gtest-1[linux,win32] selects the linux and win32 platforms for chunk 1 of gtest"
|
||||
parameters = {'try_options': parse_message('try: -u gtest-1[linux,win32]')}
|
||||
tos = TryOptionSyntax(parameters, graph_with_jobs)
|
||||
tos = TryOptionSyntax(parameters, graph_with_jobs, GRAPH_CONFIG)
|
||||
self.assertEqual(sorted(tos.unittests), sorted([
|
||||
{'test': 'gtest', 'platforms': ['linux', 'win32'], 'only_chunks': set('1')},
|
||||
]))
|
||||
@ -260,19 +268,19 @@ class TestTryOptionSyntax(unittest.TestCase):
|
||||
def test_t_none(self):
|
||||
"-t none sets talos=[]"
|
||||
parameters = {'try_options': parse_message('try: -t none')}
|
||||
tos = TryOptionSyntax(parameters, graph_with_jobs)
|
||||
tos = TryOptionSyntax(parameters, graph_with_jobs, GRAPH_CONFIG)
|
||||
self.assertEqual(sorted(tos.talos), [])
|
||||
|
||||
def test_t_all(self):
|
||||
"-t all sets talos=[..whole list..]"
|
||||
parameters = {'try_options': parse_message('try: -t all')}
|
||||
tos = TryOptionSyntax(parameters, graph_with_jobs)
|
||||
tos = TryOptionSyntax(parameters, graph_with_jobs, GRAPH_CONFIG)
|
||||
self.assertEqual(sorted(tos.talos), sorted([{'test': t} for t in talos_tasks]))
|
||||
|
||||
def test_t_single(self):
|
||||
"-t mochitest-webgl sets talos=[mochitest-webgl]"
|
||||
parameters = {'try_options': parse_message('try: -t mochitest-webgl')}
|
||||
tos = TryOptionSyntax(parameters, graph_with_jobs)
|
||||
tos = TryOptionSyntax(parameters, graph_with_jobs, GRAPH_CONFIG)
|
||||
self.assertEqual(sorted(tos.talos), sorted([{'test': 'mochitest-webgl'}]))
|
||||
|
||||
# -t shares an implementation with -u, so it's not tested heavily
|
||||
@ -280,62 +288,62 @@ class TestTryOptionSyntax(unittest.TestCase):
|
||||
def test_trigger_tests(self):
|
||||
"--rebuild 10 sets trigger_tests"
|
||||
parameters = {'try_options': parse_message('try: --rebuild 10')}
|
||||
tos = TryOptionSyntax(parameters, graph_with_jobs)
|
||||
tos = TryOptionSyntax(parameters, graph_with_jobs, GRAPH_CONFIG)
|
||||
self.assertEqual(tos.trigger_tests, 10)
|
||||
|
||||
def test_talos_trigger_tests(self):
|
||||
"--rebuild-talos 10 sets talos_trigger_tests"
|
||||
parameters = {'try_options': parse_message('try: --rebuild-talos 10')}
|
||||
tos = TryOptionSyntax(parameters, graph_with_jobs)
|
||||
tos = TryOptionSyntax(parameters, graph_with_jobs, GRAPH_CONFIG)
|
||||
self.assertEqual(tos.talos_trigger_tests, 10)
|
||||
|
||||
def test_interactive(self):
|
||||
"--interactive sets interactive"
|
||||
parameters = {'try_options': parse_message('try: --interactive')}
|
||||
tos = TryOptionSyntax(parameters, graph_with_jobs)
|
||||
tos = TryOptionSyntax(parameters, graph_with_jobs, GRAPH_CONFIG)
|
||||
self.assertEqual(tos.interactive, True)
|
||||
|
||||
def test_all_email(self):
|
||||
"--all-emails sets notifications"
|
||||
parameters = {'try_options': parse_message('try: --all-emails')}
|
||||
tos = TryOptionSyntax(parameters, graph_with_jobs)
|
||||
tos = TryOptionSyntax(parameters, graph_with_jobs, GRAPH_CONFIG)
|
||||
self.assertEqual(tos.notifications, 'all')
|
||||
|
||||
def test_fail_email(self):
|
||||
"--failure-emails sets notifications"
|
||||
parameters = {'try_options': parse_message('try: --failure-emails')}
|
||||
tos = TryOptionSyntax(parameters, graph_with_jobs)
|
||||
tos = TryOptionSyntax(parameters, graph_with_jobs, GRAPH_CONFIG)
|
||||
self.assertEqual(tos.notifications, 'failure')
|
||||
|
||||
def test_no_email(self):
|
||||
"no email settings don't set notifications"
|
||||
parameters = {'try_options': parse_message('try:')}
|
||||
tos = TryOptionSyntax(parameters, graph_with_jobs)
|
||||
tos = TryOptionSyntax(parameters, graph_with_jobs, GRAPH_CONFIG)
|
||||
self.assertEqual(tos.notifications, None)
|
||||
|
||||
def test_setenv(self):
|
||||
"--setenv VAR=value adds a environment variables setting to env"
|
||||
parameters = {'try_options': parse_message(
|
||||
'try: --setenv VAR1=value1 --setenv VAR2=value2')}
|
||||
tos = TryOptionSyntax(parameters, graph_with_jobs)
|
||||
tos = TryOptionSyntax(parameters, graph_with_jobs, GRAPH_CONFIG)
|
||||
self.assertEqual(tos.env, ['VAR1=value1', 'VAR2=value2'])
|
||||
|
||||
def test_profile(self):
|
||||
"--geckoProfile sets profile to true"
|
||||
parameters = {'try_options': parse_message('try: --geckoProfile')}
|
||||
tos = TryOptionSyntax(parameters, graph_with_jobs)
|
||||
tos = TryOptionSyntax(parameters, graph_with_jobs, GRAPH_CONFIG)
|
||||
self.assertTrue(tos.profile)
|
||||
|
||||
def test_tag(self):
|
||||
"--tag TAG sets tag to TAG value"
|
||||
parameters = {'try_options': parse_message('try: --tag tagName')}
|
||||
tos = TryOptionSyntax(parameters, graph_with_jobs)
|
||||
tos = TryOptionSyntax(parameters, graph_with_jobs, GRAPH_CONFIG)
|
||||
self.assertEqual(tos.tag, 'tagName')
|
||||
|
||||
def test_no_retry(self):
|
||||
"--no-retry sets no_retry to true"
|
||||
parameters = {'try_options': parse_message('try: --no-retry')}
|
||||
tos = TryOptionSyntax(parameters, graph_with_jobs)
|
||||
tos = TryOptionSyntax(parameters, graph_with_jobs, GRAPH_CONFIG)
|
||||
self.assertTrue(tos.no_retry)
|
||||
|
||||
|
||||
|
@ -152,35 +152,6 @@ UNITTEST_PLATFORM_PRETTY_NAMES = {
|
||||
# 'win64': [..TODO..],
|
||||
}
|
||||
|
||||
# We have a few platforms for which we want to do some "extra" builds, or at
|
||||
# least build-ish things. Sort of. Anyway, these other things are implemented
|
||||
# as different "platforms". These do *not* automatically ride along with "-p
|
||||
# all"
|
||||
RIDEALONG_BUILDS = {
|
||||
'android-api-16': [
|
||||
'android-api-16-l10n',
|
||||
],
|
||||
'linux': [
|
||||
'linux-l10n',
|
||||
],
|
||||
'linux64': [
|
||||
'linux64-l10n',
|
||||
'sm-plain',
|
||||
'sm-nonunified',
|
||||
'sm-arm-sim',
|
||||
'sm-arm64-sim',
|
||||
'sm-compacting',
|
||||
'sm-rootanalysis',
|
||||
'sm-package',
|
||||
'sm-tsan',
|
||||
'sm-asan',
|
||||
'sm-mozjs-sys',
|
||||
'sm-msan',
|
||||
'sm-fuzzing',
|
||||
'sm-rust-bindings',
|
||||
],
|
||||
}
|
||||
|
||||
TEST_CHUNK_SUFFIX = re.compile('(.*)-([0-9]+)$')
|
||||
|
||||
|
||||
@ -262,7 +233,7 @@ def parse_message(message):
|
||||
|
||||
class TryOptionSyntax(object):
|
||||
|
||||
def __init__(self, parameters, full_task_graph):
|
||||
def __init__(self, parameters, full_task_graph, graph_config):
|
||||
"""
|
||||
Apply the try options in parameters.
|
||||
|
||||
@ -289,6 +260,7 @@ class TryOptionSyntax(object):
|
||||
'only_chunks': set([..chunk numbers..]), # to limit only to certain chunks
|
||||
}
|
||||
"""
|
||||
self.graph_config = graph_config
|
||||
self.jobs = []
|
||||
self.build_types = []
|
||||
self.platforms = []
|
||||
@ -352,6 +324,7 @@ class TryOptionSyntax(object):
|
||||
if platform_arg == 'all':
|
||||
return None
|
||||
|
||||
RIDEALONG_BUILDS = self.graph_config['try']['ridealong-builds']
|
||||
results = []
|
||||
for build in platform_arg.split(','):
|
||||
results.append(build)
|
||||
|
Loading…
Reference in New Issue
Block a user