:param job_info: A dict containing the job's information.
:param base_uri: The endpoint of the results server. If you leave it out
ResultsReporter will ask teuthology.config.
- :returns: True if the run was successfully created.
"""
# We are using archive_base='' here because we KNOW the serializer isn't
# needed for this codepath.
reporter.report_job(run_name, job_id, job_json)
+def try_push_job_info(job_config, job_info=None):
+ """
+ Wrap push_job_info, gracefully doing nothing if:
+ A RequestFailedError is raised
+ config.results_server is not set
+
+ :param job_config: The ctx.config object
+ :param job_info: Dict to push (commonly None)
+ """
+ if not config.results_server:
+ msg = "No results_server set in {yaml}; not attempting to push results"
+ log.debug(msg.format(yaml=config.teuthology_yaml))
+ else:
+ run_name = job_config['name']
+ job_id = job_config['job_id']
+ if job_info is None:
+ job_info = job_config
+
+ try:
+ push_job_info(run_name, job_id, job_info)
+ except RequestFailedError:
+ log.exception("Could not report results to %s" %
+ config.results_server)
+
+
def parse_args():
parser = argparse.ArgumentParser(
description="Submit test results to a web service")
import logging
from . import report
- from .config import config as teuth_config
ctx = parse_args()
set_up_logging(ctx)
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)
-
+ report.try_push_job_info(ctx.config)
if 'targets' in ctx.config and 'roles' in ctx.config:
targets = len(ctx.config['targets'])
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)
+
+ report.try_push_job_info(ctx.config, ctx.summary)
+ report.try_push_job_info(ctx.config)
if ctx.summary.get('success', True):
log.info('pass')
import sys
sys.exit(1)
+
def schedule():
parser = argparse.ArgumentParser(description='Schedule ceph integration tests')
parser.add_argument(