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 306045 d05aa8ecdb0b184bc22a0efaaf006c26c46401de
parent 306044 d1679fda1a1fb0ff702ed261df768d8a7380fa32
child 306046 58a8eeabbe7f4cb01e895c90bb6a16df01339e4a
push id79765
push usercbook@mozilla.com
push dateThu, 21 Jul 2016 14:26:34 +0000
treeherdermozilla-inbound@ab54bfc55266 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
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):