Bug 1229379 - use mozlog test report protocol in talos. r=jmaher
--- 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']: