]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
Report results synchronously.
authorZack Cerza <zack@cerza.org>
Wed, 2 Oct 2013 23:27:09 +0000 (18:27 -0500)
committerZack Cerza <zack@cerza.org>
Thu, 3 Oct 2013 21:08:12 +0000 (16:08 -0500)
Signed-off-by: Zack Cerza <zack.cerza@inktank.com>
teuthology/run.py

index 090f394c05a62c6c1d4dde3900eb3ab2e0bf3e27..f2857c5d7c1dcfde3eca81fd98815d730ddab65e 100644 (file)
@@ -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: