Beispiel #1
0
def execute(testcase_id, current, build):
    """Execute the reproduce command."""

    print 'Reproduce %s (current=%s)' % (testcase_id, current)
    print 'Downloading testcase information...'

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

    definition = get_binary_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(
            current_testcase.id, current_testcase.build_url, binary_name)
    else:
        binary_provider = definition.builder(  # pylint: disable=redefined-variable-type
            current_testcase, definition, current, goma_dir)

    reproduce_crash(binary_provider.get_binary_path(),
                    binary_provider.symbolizer_path, current_testcase,
                    definition.sanitizer)

    maybe_warn_unreproducible(current_testcase)
 def test_running_command(self):
   """Test 'Running Command: '."""
   binary_name = common.get_binary_name([
       {'content': 'aaa'},
       {'content': 'Running command: aaa/bbb/some_fuzzer something'},
       {'content': 'bbb'}
   ])
   self.assertEqual('some_fuzzer', binary_name)
    def __init__(self, testcase, binary_definition, current, goma_dir):

        binary_name = binary_definition.binary_name
        if not binary_name:
            binary_name = common.get_binary_name(testcase.stacktrace_lines)
        super(ChromiumBuilder,
              self).__init__(testcase.id, testcase.build_url,
                             testcase.revision, current, goma_dir,
                             os.environ.get(binary_definition.source_var),
                             binary_name)
        self.git_sha = sha_from_revision(self.revision, 'chromium/src')
        self.name = 'chromium'
Beispiel #4
0
 def __init__(self, testcase, binary_definition, current, goma_dir,
              goma_threads, edit_mode):
   target_name = None
   binary_name = binary_definition.binary_name
   if binary_definition.target:
     target_name = binary_definition.target
   if not binary_name:
     binary_name = common.get_binary_name(testcase.stacktrace_lines)
   super(ChromiumBuilder, self).__init__(
       testcase.id, testcase.build_url, testcase.revision, current,
       goma_dir, os.environ.get(binary_definition.source_var), binary_name,
       target_name, goma_threads, edit_mode)
   self.git_sha = sha_from_revision(self.revision, 'chromium/src')
   self.gn_args = testcase.gn_args
   self.name = 'chromium'
  def __init__(self, testcase, definition, options):
    target_name = None
    binary_name = definition.binary_name
    if definition.target:
      target_name = definition.target
    if not binary_name:
      binary_name = common.get_binary_name(testcase.stacktrace_lines)

    super(ChromiumBuilder, self).__init__(
        name='chromium',
        testcase=testcase,
        definition=definition,
        binary_name=binary_name,
        target=target_name,
        options=options)
    self.git_sha = sha_from_revision(self.testcase.revision, 'chromium/src')
    self.gn_args = testcase.gn_args
Beispiel #6
0
def execute(testcase_id, current, build, disable_goma, j, iterations,
            disable_xvfb, target_args, edit_mode):
    """Execute the reproduce command."""
    logger.info('----- START -----')
    logger.info('Reproducing testcase %s', testcase_id)
    logger.debug(
        '  testcase_id: %s\n  current: %s\n  build: %s\n  disable_goma: %s',
        testcase_id, current, build, disable_goma)
    logger.info('Downloading testcase information...')

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

    if 'gestures' in response['testcase']:
        logger.info(
            ('Warning: testcases using gestures are still in development '
             'and are not guaranteed to reproduce correctly.'))

    definition = get_binary_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(
            current_testcase.id, current_testcase.build_url, binary_name)
    else:
        goma_dir = None if disable_goma else ensure_goma()
        binary_provider = definition.builder(  # pylint: disable=redefined-variable-type
            current_testcase, definition, current, goma_dir, j, edit_mode)

    reproducer = definition.reproducer(binary_provider, current_testcase,
                                       definition.sanitizer, disable_xvfb,
                                       target_args, edit_mode)
    try:
        reproducer.reproduce(iterations)
    finally:
        maybe_warn_unreproducible(current_testcase)
 def test_no_command(self):
     """Raise an exception when there's no command."""
     with self.assertRaises(error.MinimizationNotFinishedError):
         common.get_binary_name([{'content': 'aaa'}])
Beispiel #8
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)
 def test_no_command(self):
     """Raise an exception when there's no command."""
     with self.assertRaises(Exception):
         common.get_binary_name([{'content': 'aaa'}])
Beispiel #10
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)