Bug 1465527 - Return structured stacktrace from Marionette reftest harness. r?jgraham draft
authorAndreas Tolfsen <ato@sny.no>
Wed, 30 May 2018 18:37:13 +0100
changeset 802811 273d3ba78cf99830fdceefd25b73db5bded1d230
parent 802810 c780b2b82b2db42d9fab4ada012912df82f47895
push id111970
push userbmo:ato@sny.no
push dateFri, 01 Jun 2018 13:58:52 +0000
reviewersjgraham
bugs1465527
milestone62.0a1
Bug 1465527 - Return structured stacktrace from Marionette reftest harness. r?jgraham The reftest harness embedded in Marionette previously only included the stacktrace of the error in the "message" field to wptrunner. Now that wptrunner supports logging parent test stacktraces, this patch changes the "message" field to include the stringified error message (including the error type information) and adds a new "stack" field with the stacktrace previously logged as the error message. MozReview-Commit-ID: KlrCZi01XWC
testing/marionette/reftest.js
--- a/testing/marionette/reftest.js
+++ b/testing/marionette/reftest.js
@@ -190,17 +190,22 @@ min-width: 600px; min-height: 600px; max
       }, timeout);
     });
 
     let testRunner = (async () => {
       let result;
       try {
         result = await this.runTest(testUrl, references, expected, timeout);
       } catch (e) {
-        result = {status: STATUS.ERROR, message: e.stack, extra: {}};
+        result = {
+          status: STATUS.ERROR,
+          message: String(e),
+          stack: e.stack,
+          extra: {},
+        };
       }
       return result;
     })();
 
     let result = await Promise.race([testRunner, timeoutPromise]);
     this.parentWindow.clearTimeout(timeoutHandle);
     if (result.status === STATUS.TIMEOUT) {
       this.abort();