Bug 1229379 - use mozlog test report protocol in talos. r=jgraham,jmaher
☠☠ backed out by 419f1aa2ce35 ☠ ☠
authorJulien Pagès <j.parkouss@gmail.com>
Mon, 14 Dec 2015 15:15:42 +0100
changeset 316176 282f22cbf7ef8c719248f2bf871af4ee2de9ad5f
parent 316175 4acf219571112bca9dce8b1802bc91c1febe1f4f
child 316177 cc002565421a4a26a4c1a7b3807936f1ca5127b6
push id8516
push userjlund@mozilla.com
push dateFri, 18 Dec 2015 00:52:34 +0000
reviewersjgraham, jmaher
bugs1229379
milestone46.0a1
Bug 1229379 - use mozlog test report protocol in talos. r=jgraham,jmaher
testing/talos/talos/run_tests.py
--- a/testing/talos/talos/run_tests.py
+++ b/testing/talos/talos/run_tests.py
@@ -12,17 +12,17 @@ import traceback
 import urllib
 import utils
 import mozhttpd
 
 from mozlog import get_proxy_logger
 
 from talos.results import TalosResults
 from talos.ttest import TTest
-from talos.utils import TalosError, TalosCrash, TalosRegression
+from talos.utils import TalosError, TalosRegression
 from talos.config import get_configs, ConfigurationError
 
 # directory of this file
 here = os.path.dirname(os.path.realpath(__file__))
 LOG = get_proxy_logger()
 
 
 def useBaseTestDefaults(base, tests):
@@ -179,44 +179,46 @@ def run_tests(config, browser_config):
             datazilla_urls=[os.path.abspath('local.json')]
         )
     talos_results.check_output_formats(results_urls)
 
     httpd = setup_webserver(browser_config['webserver'])
     httpd.start()
 
     testname = None
+    # run the tests
+    timer = utils.Timer()
+    LOG.suite_start(tests=[test['name'] for test in tests])
     try:
-        # run the tests
-        timer = utils.Timer()
-        LOG.info("Starting test suite %s" % title)
         for test in tests:
             testname = test['name']
-            testtimer = utils.Timer()
-            LOG.info("Starting test %s" % testname)
+            LOG.test_start(testname)
 
             mytest = TTest()
             talos_results.add(mytest.runTest(browser_config, test))
 
-            LOG.info("Completed test %s (%s)"
-                     % (testname,  testtimer.elapsed()))
+            LOG.test_end(testname, status='OK')
 
-    except TalosRegression:
+    except TalosRegression as exc:
         LOG.error("Detected a regression for %s" % testname)
         # by returning 1, we report an orange to buildbot
         # http://docs.buildbot.net/latest/developer/results.html
+        LOG.test_end(testname, status='FAIL', message=unicode(exc),
+                     stack=traceback.format_exc())
         return 1
-    except (TalosCrash, TalosError):
+    except Exception as exc:
         # NOTE: if we get into this condition, talos has an internal
         # problem and cannot continue
         #       this will prevent future tests from running
-        traceback.print_exception(*sys.exc_info())
+        LOG.test_end(testname, status='ERROR', message=unicode(exc),
+                     stack=traceback.format_exc())
         # indicate a failure to buildbot, turn the job red
         return 2
     finally:
+        LOG.suite_end()
         httpd.stop()
 
     LOG.info("Completed test suite (%s)" % timer.elapsed())
 
     # output results
     if results_urls:
         talos_results.output(results_urls)
         if browser_config['develop']: