From: Zack Cerza Date: Wed, 2 Oct 2013 23:27:09 +0000 (-0500) Subject: Report results synchronously. X-Git-Tag: 1.1.0~1839^2~4 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=77b65c7f3c24f8039a33488b76e88a3e62cd1bee;p=teuthology.git Report results synchronously. Signed-off-by: Zack Cerza --- diff --git a/teuthology/run.py b/teuthology/run.py index 090f394c05..f2857c5d7c 100644 --- a/teuthology/run.py +++ b/teuthology/run.py @@ -6,6 +6,9 @@ import contextlib import sys from traceback import format_tb +from . import report +from .config import config as teuth_config + def config_file(string): config = {} @@ -163,6 +166,15 @@ def main(): ctx.owner = get_user() write_initial_metadata(ctx) + if teuth_config.results_server: + try: + run_name = ctx.config['name'] + report.create_run(run_name) + report.push_job_info(run_name, ctx.config['job_id'], ctx.config) + except report.RequestFailedError: + log.exception("Could not report results to %s" % + teuth_config.results_server) + if 'targets' in ctx.config and 'roles' in ctx.config: targets = len(ctx.config['targets']) @@ -247,6 +259,16 @@ def main(): subject = "Teuthology error -- %s" % ctx.summary['failure_reason'] from teuthology.suite import email_results email_results(subject,"Teuthology",ctx.config['email-on-error'],emsg) + if teuth_config.results_server: + try: + run_name = ctx.config['name'] + job_id = ctx.config['name'] + report.push_job_info(run_name, job_id, ctx.config) + report.push_job_info(run_name, job_id, ctx.summary) + except report.RequestFailedError: + log.exception("Could not report results to %s" % + teuth_config.results_server) + if ctx.summary.get('success', True): log.info('pass') else: