mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-21 01:05:45 +00:00
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:
parent
945a1bc550
commit
847aa1938f
@ -167,7 +167,7 @@ try_task_config_schema_v2 = Schema({
|
|||||||
|
|
||||||
def full_task_graph_to_runnable_jobs(full_task_json):
|
def full_task_graph_to_runnable_jobs(full_task_json):
|
||||||
runnable_jobs = {}
|
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']):
|
if not ('extra' in node['task'] and 'treeherder' in node['task']['extra']):
|
||||||
continue
|
continue
|
||||||
|
|
||||||
|
@ -4,10 +4,8 @@
|
|||||||
|
|
||||||
from __future__ import absolute_import
|
from __future__ import absolute_import
|
||||||
|
|
||||||
import sys
|
|
||||||
import unittest
|
import unittest
|
||||||
|
|
||||||
import pytest
|
|
||||||
from taskgraph.decision import full_task_graph_to_runnable_jobs
|
from taskgraph.decision import full_task_graph_to_runnable_jobs
|
||||||
from taskgraph.graph import Graph
|
from taskgraph.graph import Graph
|
||||||
from taskgraph.taskgraph import TaskGraph
|
from taskgraph.taskgraph import TaskGraph
|
||||||
@ -54,15 +52,12 @@ class TestRunnableJobs(unittest.TestCase):
|
|||||||
|
|
||||||
def make_taskgraph(self, tasks):
|
def make_taskgraph(self, tasks):
|
||||||
label_to_taskid = {k: k + '-tid' for k in 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
|
tasks[label].task_id = task_id
|
||||||
graph = Graph(nodes=set(tasks), edges=set())
|
graph = Graph(nodes=set(tasks), edges=set())
|
||||||
taskgraph = TaskGraph(tasks, graph)
|
taskgraph = TaskGraph(tasks, graph)
|
||||||
return taskgraph, label_to_taskid
|
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):
|
def test_taskgraph_to_runnable_jobs(self):
|
||||||
tg, label_to_taskid = self.make_taskgraph({
|
tg, label_to_taskid = self.make_taskgraph({
|
||||||
t['label']: Task(**t) for t in self.tasks[:]
|
t['label']: Task(**t) for t in self.tasks[:]
|
||||||
|
Loading…
Reference in New Issue
Block a user