Exemple #1
0
  def test_send_build_event_smoke(self):
    self.assertIsInstance(config._router, router._Router)
    self.assertIsInstance(config.cache.get('default_event'), ChromeInfraEvent)

    self.assertTrue(event_mon.send_build_event('BUILD',
                                               'bot.host.name',
                                               'build.name'))
    self.assertTrue(event_mon.send_build_event(
      'BUILD',
      'bot.host.name',
      'build_name',
      build_number=1,
      build_scheduling_time=123456789,
      result='FAILURE',
      timestamp_kind='POINT',
      event_timestamp=None))
Exemple #2
0
def send_build_event(args):
    """Entry point when --build-event-type is passed."""
    return bool(
        event_mon.send_build_event(
            args.build_event_type,
            args.build_event_hostname,
            args.build_event_build_name,
            build_number=args.build_event_build_number,
            build_scheduling_time=args.build_event_build_scheduling_time,
            step_name=args.build_event_step_name,
            step_number=args.build_event_step_number,
            result=args.build_event_result,
            timestamp_kind=args.event_mon_timestamp_kind,
            event_timestamp=args.event_mon_event_timestamp))
Exemple #3
0
def send_build_event(args):
    """Entry point when --build-event-type is passed."""
    return bool(
        event_mon.send_build_event(
            args.build_event_type,
            args.build_event_hostname,
            args.build_event_build_name,
            build_number=args.build_event_build_number,
            build_scheduling_time=args.build_event_build_scheduling_time,
            step_name=args.build_event_step_name,
            step_number=args.build_event_step_number,
            result=args.build_event_result,
            timestamp_kind=args.event_mon_timestamp_kind,
            event_timestamp=args.event_mon_event_timestamp,
        )
    )
Exemple #4
0
def send_build_event(args):
    """Entry point when --build-event-type is passed."""
    goma_stats = None
    if args.build_event_goma_stats_path:
        try:
            with open(args.build_event_goma_stats_path, 'rb') as f:
                goma_stats = GomaStats.FromString(f.read())
        except Exception:
            LOGGER.exception('Failure when reading/parsing file %s',
                             args.build_event_goma_stats_path)
            raise

    goma_crash_report_id = None
    if args.build_event_goma_crash_report_id_path:
        try:
            with open(args.build_event_goma_crash_report_id_path, 'r') as f:
                goma_crash_report_id = f.read().strip()
        except Exception:  # pragma: no cover
            LOGGER.exception('Failure when reading/parsing file %s',
                             args.build_event_goma_crash_report_id_path)
            raise

    return bool(
        event_mon.send_build_event(
            args.build_event_type,
            args.build_event_hostname,
            args.build_event_build_name,
            build_number=args.build_event_build_number,
            build_scheduling_time=args.build_event_build_scheduling_time,
            step_name=args.build_event_step_name,
            step_text=args.build_event_step_text,
            step_number=args.build_event_step_number,
            result=args.build_event_result,
            extra_result_code=args.build_event_extra_result_code,
            patch_url=args.build_event_patch_url,
            bbucket_id=args.build_event_bbucket_id,
            category=args.build_event_category,
            head_revision_git_hash=args.build_event_head_revision_git_hash,
            timestamp_kind=args.event_mon_timestamp_kind,
            event_timestamp=args.event_mon_event_timestamp,
            goma_stats=goma_stats,
            goma_error=args.build_event_goma_error,
            goma_crash_report_id=goma_crash_report_id))
Exemple #5
0
def send_build_event(args):
    """Entry point when --build-event-type is passed."""
    return bool(
        event_mon.send_build_event(
            args.build_event_type,
            args.build_event_hostname,
            args.build_event_build_name,
            build_number=args.build_event_build_number,
            build_scheduling_time=args.build_event_build_scheduling_time,
            step_name=args.build_event_step_name,
            step_text=args.build_event_step_text,
            step_number=args.build_event_step_number,
            result=args.build_event_result,
            extra_result_code=args.build_event_extra_result_code,
            patch_url=args.build_event_patch_url,
            bbucket_id=args.build_event_bbucket_id,
            category=args.build_event_category,
            fail_type=args.build_event_fail_type,
            head_revision_git_hash=args.build_event_head_revision_git_hash,
            timestamp_kind=args.event_mon_timestamp_kind,
            event_timestamp=args.event_mon_event_timestamp))
Exemple #6
0
def send_build_event(args):
  """Entry point when --build-event-type is passed."""
  goma_stats = None
  if args.build_event_goma_stats_path:
    try:
      with open(args.build_event_goma_stats_path, 'rb') as f:
        goma_stats = GomaStats.FromString(f.read())
    except Exception:
      LOGGER.exception('Failure when reading/parsing file %s',
                       args.build_event_goma_stats_path)
      raise

  goma_crash_report_id = None
  if args.build_event_goma_crash_report_id_path:
    try:
      with open(args.build_event_goma_crash_report_id_path, 'r') as f:
        goma_crash_report_id = f.read().strip()
    except Exception:  # pragma: no cover
      LOGGER.exception('Failure when reading/parsing file %s',
                       args.build_event_goma_crash_report_id_path)
      raise

  return bool(event_mon.send_build_event(
    args.build_event_type,
    args.build_event_hostname,
    args.build_event_build_name,
    build_number=args.build_event_build_number,
    build_scheduling_time=args.build_event_build_scheduling_time,
    step_name=args.build_event_step_name,
    step_number=args.build_event_step_number,
    result=args.build_event_result,
    extra_result_code=args.build_event_extra_result_code,
    patch_url=args.build_event_patch_url,
    timestamp_kind=args.event_mon_timestamp_kind,
    event_timestamp=args.event_mon_event_timestamp,
    goma_stats=goma_stats,
    goma_error=args.build_event_goma_error,
    goma_crash_report_id=goma_crash_report_id))