Bug 1638990: [taskgraph] Make test_util_runnable_jobs pass on python 3; r=ahal

Differential Revision: https://phabricator.services.mozilla.com/D84077
This commit is contained in:
Tom Prince 2020-07-20 19:27:09 +00:00
Родитель 945a1bc550
Коммит 847aa1938f
2 изменённых файлов: 2 добавлений и 7 удалений

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

@ -167,7 +167,7 @@ try_task_config_schema_v2 = Schema({
def full_task_graph_to_runnable_jobs(full_task_json):
runnable_jobs = {}
for label, node in full_task_json.iteritems():
for label, node in six.iteritems(full_task_json):
if not ('extra' in node['task'] and 'treeherder' in node['task']['extra']):
continue

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

@ -4,10 +4,8 @@
from __future__ import absolute_import
import sys
import unittest
import pytest
from taskgraph.decision import full_task_graph_to_runnable_jobs
from taskgraph.graph import Graph
from taskgraph.taskgraph import TaskGraph
@ -54,15 +52,12 @@ class TestRunnableJobs(unittest.TestCase):
def make_taskgraph(self, tasks):
label_to_taskid = {k: k + '-tid' for k in tasks}
for label, task_id in label_to_taskid.iteritems():
for label, task_id in label_to_taskid.items():
tasks[label].task_id = task_id
graph = Graph(nodes=set(tasks), edges=set())
taskgraph = TaskGraph(tasks, graph)
return taskgraph, label_to_taskid
@pytest.mark.xfail(
sys.version_info >= (3, 0), reason="python3 migration is not complete"
)
def test_taskgraph_to_runnable_jobs(self):
tg, label_to_taskid = self.make_taskgraph({
t['label']: Task(**t) for t in self.tasks[:]