Bug 1043485 - Save last Android robocop test name when logs are unstructured. r=edmorley, a=test-only
authorAhmed Kachkach <ahmed.kachkach@gmail.com>
Fri, 25 Jul 2014 11:26:00 +0200
changeset 217534 40bd25be82639d5a2330bb65c06b0b015e6f0bfa
parent 217533 7d0337de2e1567beb3e0c20dd5c4ae223701f94d
child 217535 9c6878ecff953868d63a1c7139539d743d81ae5c
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)
reviewersedmorley, test-only
bugs1043485
milestone33.0a2
Bug 1043485 - Save last Android robocop test name when logs are unstructured. r=edmorley, a=test-only
testing/mochitest/runtests.py
--- a/testing/mochitest/runtests.py
+++ b/testing/mochitest/runtests.py
@@ -1968,30 +1968,40 @@ class Mochitest(MochitestUtilsMixin):
       if message['action'] == 'log' and self.stackFixerFunction:
         message['message'] = self.stackFixerFunction(message['message'].encode('utf-8', 'replace'))
       return message
 
     def record_last_test(self, message):
       """record last test on harness"""
       if message['action'] == 'test_start':
         self.harness.lastTestSeen = message['test']
+      elif message['action'] == 'log' and 'TEST-START' in message['message'] and '|' in message['message']:
+        self.harness.lastTestSeen = message['message'].split("|")[1].strip()
       return message
 
     def dumpScreenOnTimeout(self, message):
       if (not self.dump_screen_on_fail
           and self.dump_screen_on_timeout
           and 'expected' in message and message['status'] == 'FAIL'
           and 'message' in message
           and "Test timed out" in message['message']):
         self.harness.dumpScreen(self.utilityPath)
+      elif (not self.dump_screen_on_fail
+            and self.dump_screen_on_timeout
+            and message['action'] == 'log'
+            and 'TEST-UNEXPECTED-FAIL' in message['message']
+            and 'Test timed out' in message['message']):
+        self.harness.dumpScreen(self.utilityPath)
       return message
 
     def dumpScreenOnFail(self, message):
       if self.dump_screen_on_fail and 'expected' in message and message['status'] == 'FAIL':
         self.harness.dumpScreen(self.utilityPath)
+      elif self.dump_screen_on_fail and message['action'] == 'log' and 'TEST-UNEXPECTED-FAIL' in message['message']:
+        self.harness.dumpScreen(self.utilityPath)
       return message
 
     def trackLSANLeaks(self, message):
       if self.lsanLeaks and message['action'] == 'log':
         self.lsanLeaks.log(message['message'])
       return message
 
     def trackShutdownLeaks(self, message):