Bug 1041708 - Structured logging seems to eat test case name and message if a single test is executed. r=ahal, a=test-only
authorAhmed Kachkach <ahmed.kachkach@gmail.com>
Mon, 21 Jul 2014 13:11:00 +0200
changeset 217556 545626e3970958959aaa46563a43d81f50cf4d14
parent 217555 49ab397b8c557c7571154a219edecf1327d96364
child 217557 5e1e03a7e25c1504b1f5bbe1e595d6ac29ccce0e
push id515
push userraliiev@mozilla.com
push dateMon, 06 Oct 2014 12:51:51 +0000
treeherdermozilla-release@267c7a481bef [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersahal, test-only
bugs1041708
milestone33.0a2
Bug 1041708 - Structured logging seems to eat test case name and message if a single test is executed. r=ahal, a=test-only
testing/mochitest/tests/SimpleTest/SimpleTest.js
--- a/testing/mochitest/tests/SimpleTest/SimpleTest.js
+++ b/testing/mochitest/tests/SimpleTest/SimpleTest.js
@@ -361,25 +361,26 @@ SimpleTest._logResult = function (test, 
         }
 
         parentRunner.structuredLogger.testStatus(url,
                                                  subtest,
                                                  result.status,
                                                  result.expected,
                                                  diagnostic);
     } else if (typeof dump === "function") {
-        var debugMsg = [url, result.message, diagnostic].join(' | ');
+        var diagMessage = test.name + (test.diag ? " - " + test.diag : "");
+        var debugMsg = [result.message, url, diagMessage].join(' | ');
         dump(debugMsg + "\n");
     } else {
         // Non-Mozilla browser?  Just do nothing.
     }
 };
 
 SimpleTest.info = function(name, message) {
-    var log = name + ' | ' + message;
+    var log = message ? name + ' | ' + message : name;
     if (parentRunner) {
         parentRunner.structuredLogger.info(log);
     } else {
         dump(log + '\n');
     }
 };
 
 /**