Bug 1288220 - Adding a from_json() class method to TestTask. r=dustin
authorKalpesh Krishna <kalpeshk2011@gmail.com>
Thu, 21 Jul 2016 01:27:21 +0530
changeset 305841 d05aa8ecdb0b
parent 305840 d1679fda1a1f
child 305842 58a8eeabbe7f
push id30727
push userdmitchell@mozilla.com
push date2016-07-20 20:07 +0000
treeherderautoland@d05aa8ecdb0b [default view] [failures only]
reviewersdustin
bugs1288220
milestone50.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1288220 - Adding a from_json() class method to TestTask. r=dustin MozReview-Commit-ID: 5HYb4jf4ATT
taskcluster/taskgraph/task/test.py
--- a/taskcluster/taskgraph/task/test.py
+++ b/taskcluster/taskgraph/task/test.py
@@ -136,16 +136,22 @@ class TestTask(base.Task):
     def load_transforms(cls, transforms_cfg):
         """Load the transforms specified in kind.yml"""
         transforms = []
         for path in transforms_cfg:
             transform = find_object(path)
             transforms.append(transform)
         return transforms
 
+    @classmethod
+    def from_json(cls, task_dict):
+        test_task = cls(kind=task_dict['attributes']['kind'],
+                        task=task_dict)
+        return test_task
+
     def __init__(self, kind, task):
         self.dependencies = task['dependencies']
         super(TestTask, self).__init__(kind, task['label'], task['attributes'], task['task'])
 
     def get_dependencies(self, taskgraph):
         return [(label, name) for name, label in self.dependencies.items()]
 
     def optimize(self):