Bug 1287019 - part1: make mozlog's HTML format support wptrunner screenshot. r=jmaher
authorJeremy Chen <jeremychen@mozilla.com>
Mon, 18 Jul 2016 13:53:58 +0800
changeset 305398 124addcb422ff6cf7756fa1b55ca67f98dbb9187
parent 305397 bea2a824598cf3a4f016954cfb004e4f21b3c5c3
child 305399 248eb6469a616be3f33df4fc2756d41689cfdf38
push id30463
push usercbook@mozilla.com
push dateTue, 19 Jul 2016 14:02:45 +0000
treeherdermozilla-central@37cc0da01187 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjmaher
bugs1287019
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 1287019 - part1: make mozlog's HTML format support wptrunner screenshot. r=jmaher Current mozlog (v3.2) doesn't support screenshot logs exported from wptrunner. Add this support so we could run css test with --log-html to see more detail information, such as screenshots of test/reference pages. DONTBUILD (NPOTB) MozReview-Commit-ID: AUJwYfvNfda
testing/mozbase/mozlog/mozlog/formatters/html/html.py
--- a/testing/mozbase/mozlog/mozlog/formatters/html/html.py
+++ b/testing/mozbase/mozlog/mozlog/formatters/html/html.py
@@ -92,16 +92,26 @@ class HTMLFormatter(base.BaseFormatter):
 
     def test_end(self, data):
         self.make_result_html(data)
 
     def make_result_html(self, data):
         tc_time = (data["time"] - self.start_times.pop(data["test"])) / 1000.
         additional_html = []
         debug = data.get("extra", {})
+        # Add support for log exported from wptrunner. The structure of
+        # reftest_screenshots is listed in wptrunner/executors/base.py.
+        if debug.get('reftest_screenshots'):
+            log_data = debug.get("reftest_screenshots", {})
+            debug = {
+                'image1':'data:image/png;base64,' + log_data[0].get("screenshot", {}),
+                'image2':'data:image/png;base64,' + log_data[2].get("screenshot", {}),
+                'differences': "Not Implemented",
+            }
+
         links_html = []
 
         status = status_name = data["status"]
         expected = data.get("expected", status)
 
         if status != expected:
             status_name = "UNEXPECTED_" + status
         elif status not in ("PASS", "SKIP"):