Bug 1113095 - Handle failing reftests in machformatter's summarizing code; r=jgraham
authorMs2ger <ms2ger@gmail.com>
Fri, 19 Dec 2014 11:25:51 +0100
changeset 220590 c3f0b8d35d8c95411fb62b7792b8b34c4efdb979
parent 220589 84b9872f54c7271f9c05212bff86332b3413c458
child 220591 bc096fd3062653f1bf532a629f0a16471ca030a5
push id10503
push userryanvm@gmail.com
push dateFri, 19 Dec 2014 20:13:42 +0000
treeherderfx-team@98ee95ac6be5 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjgraham
bugs1113095
milestone37.0a1
Bug 1113095 - Handle failing reftests in machformatter's summarizing code; r=jgraham
testing/mozbase/mozlog/mozlog/structured/formatters/machformatter.py
--- a/testing/mozbase/mozlog/mozlog/structured/formatters/machformatter.py
+++ b/testing/mozbase/mozlog/mozlog/structured/formatters/machformatter.py
@@ -88,16 +88,25 @@ class MachFormatter(base.BaseFormatter):
         return "%s %s: %s %s\n" % (time, action, thread, s)
 
     def _get_test_id(self, data):
         test_id = data.get("test")
         if isinstance(test_id, list):
             test_id = tuple(test_id)
         return test_id
 
+    def _get_file_name(self, test_id):
+        if isinstance(test_id, (str, unicode)):
+            return test_id
+
+        if isinstance(test_id, tuple):
+            return "".join(test_id)
+
+        assert False, "unexpected test_id"
+
     def suite_start(self, data):
         self.summary_values = {"tests": 0,
                                "subtests": 0,
                                "expected": 0,
                                "unexpected": defaultdict(int),
                                "skipped": 0}
         self.summary_unexpected = []
         return "%i" % len(data["tests"])
@@ -134,24 +143,26 @@ class MachFormatter(base.BaseFormatter):
         rv.append("")
 
         if not self.summary_values["unexpected"]:
             rv.append(term.green("OK"))
         else:
             heading = "Unexpected Results"
             rv.extend([heading, "=" * len(heading), ""])
             if has_subtests:
-                for test, results in self.summary_unexpected:
+                for test_id, results in self.summary_unexpected:
+                    test = self._get_file_name(test_id)
                     rv.extend([test, "-" * len(test)])
                     for name, status, expected, message in results:
                         if name is None:
                             name = "[Parent]"
                         rv.append("%s %s" % (self.format_expected(status, expected), name))
             else:
-                for test, results in self.summary_unexpected:
+                for test_id, results in self.summary_unexpected:
+                    test = self._get_file_name(test_id)
                     assert len(results) == 1
                     name, status, expected, messge = results[0]
                     assert name is None
                     rv.append("%s %s" % (self.format_expected(status, expected), test))
 
         return "\n".join(rv)
 
     def format_expected(self, status, expected):