Exemplo n.º 1
0
def make_options(testcase_id='1',
                 current=False,
                 build='chromium',
                 disable_goma=False,
                 goma_threads=10,
                 goma_load=8,
                 iterations=11,
                 disable_xvfb=False,
                 target_args=None,
                 edit_mode=False,
                 skip_deps=False,
                 enable_debug=False,
                 extra_log_params=None,
                 force=False):
    """Make an option."""
    extra_log_params = extra_log_params or {}
    return common.Options(testcase_id=testcase_id,
                          current=current,
                          build=build,
                          disable_goma=disable_goma,
                          goma_threads=goma_threads,
                          goma_load=goma_load,
                          iterations=iterations,
                          disable_xvfb=disable_xvfb,
                          target_args=target_args,
                          edit_mode=edit_mode,
                          skip_deps=skip_deps,
                          enable_debug=enable_debug,
                          extra_log_params=extra_log_params,
                          force=force)
Exemplo n.º 2
0
def make_options(
    testcase_id='1',
    current=False,
    build='chromium',
    disable_goma=False,
    goma_threads=10,
    goma_load=8,
    iterations=11,
    disable_xvfb=False,
    target_args=None,
    edit_mode=False,
    skip_deps=False,
    enable_debug=False,
    goma_dir=None):
  return common.Options(
      testcase_id=testcase_id,
      current=current,
      build=build,
      disable_goma=disable_goma,
      goma_threads=goma_threads,
      goma_load=goma_load,
      iterations=iterations,
      disable_xvfb=disable_xvfb,
      target_args=target_args,
      edit_mode=edit_mode,
      skip_deps=skip_deps,
      enable_debug=enable_debug,
      goma_dir=goma_dir)
Exemplo n.º 3
0
def execute(testcase_id, current, build, disable_goma, goma_threads, goma_load,
            iterations, disable_xvfb, target_args, edit_mode, skip_deps,
            enable_debug, extra_log_params):
  """Execute the reproduce command."""
  options = common.Options(
      testcase_id=testcase_id,
      current=current,
      build=build,
      disable_goma=disable_goma,
      goma_threads=goma_threads,
      goma_load=goma_load,
      iterations=iterations,
      disable_xvfb=disable_xvfb,
      target_args=target_args,
      edit_mode=edit_mode,
      skip_deps=skip_deps,
      enable_debug=enable_debug,
      extra_log_params=extra_log_params)

  logger.info('Reproducing testcase %s', testcase_id)
  logger.debug('%s', str(options))

  common.ensure_important_dirs()

  current_testcase, identity = get_testcase_and_identity(testcase_id)
  extra_log_params['identity'] = identity
  extra_log_params['job_type'] = current_testcase.job_type
  extra_log_params['platform'] = current_testcase.platform
  extra_log_params['reproducible'] = current_testcase.reproducible
  # A hack to download testcase early. Otherwise, OAuth access token might
  # expire after compiling (~1h).
  current_testcase.get_testcase_path()
  definition = get_definition(current_testcase.job_type, testcase_id, build)

  warn_unreproducible_if_needed(current_testcase)

  binary_provider = create_builder_class(build, definition)(
      testcase=current_testcase,
      definition=definition,
      options=options)
  binary_provider.build()

  reproducer = definition.reproducer(
      definition=definition,
      binary_provider=binary_provider,
      testcase=current_testcase,
      sanitizer=definition.sanitizer,
      options=options)
  try:
    reproducer.reproduce(iterations)
  finally:
    warn_unreproducible_if_needed(current_testcase)
Exemplo n.º 4
0
def execute(testcase_id,
            current,
            build,
            disable_goma,
            goma_threads,
            iterations,
            disable_xvfb,
            target_args,
            edit_mode,
            disable_gclient,
            enable_debug,
            goma_dir=None):
    """Execute the reproduce command."""
    options = common.Options(testcase_id=testcase_id,
                             current=current,
                             build=build,
                             disable_goma=disable_goma,
                             goma_threads=goma_threads,
                             iterations=iterations,
                             disable_xvfb=disable_xvfb,
                             target_args=target_args,
                             edit_mode=edit_mode,
                             disable_gclient=disable_gclient,
                             enable_debug=enable_debug,
                             goma_dir=goma_dir)

    logger.info('Reproducing testcase %s', testcase_id)
    logger.debug('%s', str(options))
    logger.info('Downloading testcase information...')

    response = get_testcase_info(testcase_id)
    current_testcase = testcase.Testcase(response)

    if 'gestures' in response['testcase']:
        logger.info(
            common.colorize(
                'Warning: the testcase is using gestures and inherently flaky. '
                "Therefore, we cannot guaranteed that it'll reproduce correctly.",
                common.BASH_YELLOW_MARKER))

    definition = get_definition(current_testcase.job_type, build)

    maybe_warn_unreproducible(current_testcase)

    if build == 'download':
        if definition.binary_name:
            binary_name = definition.binary_name
        else:
            binary_name = common.get_binary_name(
                current_testcase.stacktrace_lines)
        binary_provider = binary_providers.DownloadedBinary(
            testcase_id=current_testcase.id,
            build_url=current_testcase.build_url,
            binary_name=binary_name)
    else:
        options.goma_dir = None if options.disable_goma else ensure_goma()
        binary_provider = definition.builder(testcase=current_testcase,
                                             definition=definition,
                                             options=options)

    reproducer = definition.reproducer(definition=definition,
                                       binary_provider=binary_provider,
                                       testcase=current_testcase,
                                       sanitizer=definition.sanitizer,
                                       options=options)
    try:
        reproducer.reproduce(iterations)
    finally:
        maybe_warn_unreproducible(current_testcase)
Exemplo n.º 5
0
def execute(testcase_id,
            current,
            build,
            disable_goma,
            goma_threads,
            goma_load,
            iterations,
            disable_xvfb,
            target_args,
            edit_mode,
            skip_deps,
            enable_debug,
            goma_dir=None):
    """Execute the reproduce command."""
    options = common.Options(testcase_id=testcase_id,
                             current=current,
                             build=build,
                             disable_goma=disable_goma,
                             goma_threads=goma_threads,
                             goma_load=goma_load,
                             iterations=iterations,
                             disable_xvfb=disable_xvfb,
                             target_args=target_args,
                             edit_mode=edit_mode,
                             skip_deps=skip_deps,
                             enable_debug=enable_debug,
                             goma_dir=goma_dir)

    logger.info('Reproducing testcase %s', testcase_id)
    logger.debug('%s', str(options))
    logger.info('Downloading testcase information...')

    response = get_testcase_info(testcase_id)
    current_testcase = testcase.Testcase(response)

    definition = get_definition(current_testcase.job_type, build)

    warn_unreproducible_if_needed(current_testcase)

    if build == 'download':
        if definition.binary_name:
            binary_name = definition.binary_name
        else:
            binary_name = common.get_binary_name(
                current_testcase.stacktrace_lines)
        binary_provider = binary_providers.DownloadedBinary(
            testcase_id=current_testcase.id,
            build_url=current_testcase.build_url,
            binary_name=binary_name)
    else:
        options.goma_dir = None if options.disable_goma else ensure_goma()
        binary_provider = definition.builder(testcase=current_testcase,
                                             definition=definition,
                                             options=options)

    reproducer = definition.reproducer(definition=definition,
                                       binary_provider=binary_provider,
                                       testcase=current_testcase,
                                       sanitizer=definition.sanitizer,
                                       options=options)
    try:
        reproducer.reproduce(iterations)
    finally:
        warn_unreproducible_if_needed(current_testcase)