Bug 1611566 - support python3 syntax in taskcluster/taskgraph/try_option_syntax.py r=Callek
Changes: Replaces all instances of `itervlaues` and `iteritems` with `six` variant in try_option_syntax.py. Differential Revision: https://phabricator.services.mozilla.com/D61055
This commit is contained in:
@@ -9,6 +9,7 @@ import copy
|
|||||||
import logging
|
import logging
|
||||||
import re
|
import re
|
||||||
import shlex
|
import shlex
|
||||||
|
import six
|
||||||
from collections import defaultdict
|
from collections import defaultdict
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
@@ -295,7 +296,7 @@ class TryOptionSyntax(object):
|
|||||||
|
|
||||||
def generate_test_tiers(self, full_task_graph):
|
def generate_test_tiers(self, full_task_graph):
|
||||||
retval = defaultdict(set)
|
retval = defaultdict(set)
|
||||||
for t in full_task_graph.tasks.itervalues():
|
for t in six.itervalues(full_task_graph.tasks):
|
||||||
if t.attributes.get('kind') == 'test':
|
if t.attributes.get('kind') == 'test':
|
||||||
try:
|
try:
|
||||||
tier = t.task['extra']['treeherder']['tier']
|
tier = t.task['extra']['treeherder']['tier']
|
||||||
@@ -320,11 +321,11 @@ class TryOptionSyntax(object):
|
|||||||
if build_types_arg is None:
|
if build_types_arg is None:
|
||||||
build_types_arg = []
|
build_types_arg = []
|
||||||
|
|
||||||
build_types = filter(None, [BUILD_TYPE_ALIASES.get(build_type) for
|
build_types = [_f for _f in (BUILD_TYPE_ALIASES.get(build_type) for
|
||||||
build_type in build_types_arg])
|
build_type in build_types_arg) if _f]
|
||||||
|
|
||||||
all_types = set(t.attributes['build_type']
|
all_types = set(t.attributes['build_type']
|
||||||
for t in full_task_graph.tasks.itervalues()
|
for t in six.itervalues(full_task_graph.tasks)
|
||||||
if 'build_type' in t.attributes)
|
if 'build_type' in t.attributes)
|
||||||
bad_types = set(build_types) - all_types
|
bad_types = set(build_types) - all_types
|
||||||
if bad_types:
|
if bad_types:
|
||||||
@@ -349,10 +350,10 @@ class TryOptionSyntax(object):
|
|||||||
(build, ', '.join(RIDEALONG_BUILDS[build])))
|
(build, ', '.join(RIDEALONG_BUILDS[build])))
|
||||||
|
|
||||||
test_platforms = set(t.attributes['test_platform']
|
test_platforms = set(t.attributes['test_platform']
|
||||||
for t in full_task_graph.tasks.itervalues()
|
for t in six.itervalues(full_task_graph.tasks)
|
||||||
if 'test_platform' in t.attributes)
|
if 'test_platform' in t.attributes)
|
||||||
build_platforms = set(t.attributes['build_platform']
|
build_platforms = set(t.attributes['build_platform']
|
||||||
for t in full_task_graph.tasks.itervalues()
|
for t in six.itervalues(full_task_graph.tasks)
|
||||||
if 'build_platform' in t.attributes)
|
if 'build_platform' in t.attributes)
|
||||||
all_platforms = test_platforms | build_platforms
|
all_platforms = test_platforms | build_platforms
|
||||||
bad_platforms = set(results) - all_platforms
|
bad_platforms = set(results) - all_platforms
|
||||||
@@ -378,7 +379,7 @@ class TryOptionSyntax(object):
|
|||||||
return []
|
return []
|
||||||
|
|
||||||
all_platforms = set(t.attributes['test_platform'].split('/')[0]
|
all_platforms = set(t.attributes['test_platform'].split('/')[0]
|
||||||
for t in full_task_graph.tasks.itervalues()
|
for t in six.itervalues(full_task_graph.tasks)
|
||||||
if 'test_platform' in t.attributes)
|
if 'test_platform' in t.attributes)
|
||||||
|
|
||||||
tests = self.parse_test_opts(test_arg, all_platforms)
|
tests = self.parse_test_opts(test_arg, all_platforms)
|
||||||
@@ -387,7 +388,7 @@ class TryOptionSyntax(object):
|
|||||||
return []
|
return []
|
||||||
|
|
||||||
all_tests = set(t.attributes[attr_name]
|
all_tests = set(t.attributes[attr_name]
|
||||||
for t in full_task_graph.tasks.itervalues()
|
for t in six.itervalues(full_task_graph.tasks)
|
||||||
if attr_name in t.attributes)
|
if attr_name in t.attributes)
|
||||||
|
|
||||||
# Special case where tests is 'all' and must be expanded
|
# Special case where tests is 'all' and must be expanded
|
||||||
@@ -544,7 +545,7 @@ class TryOptionSyntax(object):
|
|||||||
|
|
||||||
def find_all_attribute_suffixes(self, graph, prefix):
|
def find_all_attribute_suffixes(self, graph, prefix):
|
||||||
rv = set()
|
rv = set()
|
||||||
for t in graph.tasks.itervalues():
|
for t in six.itervalues(graph.tasks):
|
||||||
for a in t.attributes:
|
for a in t.attributes:
|
||||||
if a.startswith(prefix):
|
if a.startswith(prefix):
|
||||||
rv.add(a[len(prefix):])
|
rv.add(a[len(prefix):])
|
||||||
|
|||||||
Reference in New Issue
Block a user