Bug 1265584 - Output asserts to wptreport.json, r=maja_zf draft
authorJames Graham <james@hoppipolla.co.uk>
Thu, 10 May 2018 15:43:30 +0100
changeset 796308 89f6f94a06feaf252025cf8506cd43a5cddaf495
parent 796307 aa4f1a5abcb6d372b9060490db1ee878fec15249
child 796309 4fa89a7474525c3afb3d41b81b349415d538cabb
push id110205
push userbmo:james@hoppipolla.co.uk
push dateThu, 17 May 2018 13:42:46 +0000
reviewersmaja_zf
bugs1265584
milestone62.0a1
Bug 1265584 - Output asserts to wptreport.json, r=maja_zf In the future we want to update metadata using the wptreport.json data, since that's much much smaller and easier to parse. In addition, this is required to determine if a test fully passed, so it makes sense to store it here. MozReview-Commit-ID: ErYT33BhqGg
testing/web-platform/tests/tools/wptrunner/wptrunner/formatters.py
--- a/testing/web-platform/tests/tools/wptrunner/wptrunner/formatters.py
+++ b/testing/web-platform/tests/tools/wptrunner/wptrunner/formatters.py
@@ -44,22 +44,26 @@ class WptreportFormatter(BaseFormatter):
         }
         test["subtests"].append(subtest)
 
         return subtest
 
     def test_status(self, data):
         subtest = self.create_subtest(data)
         subtest["status"] = data["status"]
+        if "expected" in data:
+            subtest["expected"] = data["expected"]
         if "message" in data:
             subtest["message"] = data["message"]
 
     def test_end(self, data):
         test = self.find_or_create_test(data)
         test["status"] = data["status"]
+        if "expected" in data:
+            test["expected"] = data["expected"]
         if "message" in data:
             test["message"] = data["message"]
 
     def assertion_count(self, data):
         test = self.find_or_create_test(data)
         test["asserts"] = {
             "count": data["count"],
             "min": data["min_expected"],