示例#1
0
def RetrieveOutputJson(isolate_server, isolate_hash, filename):
  logging.debug(
      'Retrieving json output (%s, %s, %s)',
      isolate_server, isolate_hash, filename)

  output_files = json.loads(isolate.Retrieve(
      isolate_server, isolate_hash))['files']
  logging.debug('response: %s', output_files)

  if filename not in output_files:
    if 'performance_browser_tests' not in filename:
      raise errors.ReadValueNoFile(filename)

    # TODO(simonhatch): Remove this once crbug.com/947501 is resolved.
    filename = filename.replace(
        'performance_browser_tests', 'browser_tests')
    if filename not in output_files:
      raise errors.ReadValueNoFile(filename)

  output_json_isolate_hash = output_files[filename]['h']
  logging.debug('Retrieving %s', output_json_isolate_hash)

  # TODO(dberris): Use incremental json parsing through a file interface, to
  # avoid having to load the whole string contents in memory. See
  # https://crbug.com/998517 for more context.
  response = json.loads(
      isolate.Retrieve(isolate_server, output_json_isolate_hash))
  logging.debug('response: %s', response)

  return response
示例#2
0
def _RetrieveOutputJson(isolate_server, isolate_hash, filename):
    logging.debug('Retrieving json output (%s, %s, %s)', isolate_server,
                  isolate_hash, filename)

    output_files = json.loads(isolate.Retrieve(isolate_server,
                                               isolate_hash))['files']
    logging.debug('response: %s', output_files)

    if filename not in output_files:
        if 'performance_browser_tests' not in filename:
            raise errors.ReadValueNoFile(filename)

        # TODO(simonhatch): Remove this once crbug.com/947501 is resolved.
        filename = filename.replace('performance_browser_tests',
                                    'browser_tests')
        if filename not in output_files:
            raise errors.ReadValueNoFile(filename)

    output_json_isolate_hash = output_files[filename]['h']
    logging.debug('Retrieving %s', output_json_isolate_hash)

    response = json.loads(
        isolate.Retrieve(isolate_server, output_json_isolate_hash))
    logging.debug('response: %s', response)

    return response
示例#3
0
def _RetrieveOutputJson(isolate_server, isolate_hash, filename):
    output_files = json.loads(isolate.Retrieve(isolate_server,
                                               isolate_hash))['files']

    if filename not in output_files:
        if 'performance_browser_tests' not in filename:
            raise errors.ReadValueNoFile(filename)

        # TODO(simonhatch): Remove this once crbug.com/947501 is resolved.
        filename = filename.replace('performance_browser_tests',
                                    'browser_tests')
        if filename not in output_files:
            raise errors.ReadValueNoFile(filename)
    output_json_isolate_hash = output_files[filename]['h']
    return json.loads(
        isolate.Retrieve(isolate_server, output_json_isolate_hash))
示例#4
0
def RetrieveIsolateOutput(isolate_server, isolate_hash, filename):
    logging.debug('Retrieving output (%s, %s, %s)', isolate_server,
                  isolate_hash, filename)

    retrieve_result = isolate.Retrieve(isolate_server, isolate_hash)
    response = json.loads(retrieve_result)
    output_files = response.get('files', {})

    if filename not in output_files:
        if 'performance_browser_tests' not in filename:
            raise errors.ReadValueNoFile(filename)

        # TODO(simonhatch): Remove this once crbug.com/947501 is resolved.
        filename = filename.replace('performance_browser_tests',
                                    'browser_tests')
        if filename not in output_files:
            raise errors.ReadValueNoFile(filename)

    output_isolate_hash = output_files[filename]['h']
    logging.debug('Retrieving %s', output_isolate_hash)

    return isolate.Retrieve(isolate_server, output_isolate_hash)
示例#5
0
 def _GetNodeByName(name, nodes):
     for node in nodes:
         if node['name'] == name:
             return node
     raise errors.ReadValueNoFile(path)