Beispiel #1
0
def CreateGraph(options):
    if not isinstance(options, TaskOptions):
        raise ValueError('options is not an instance of run_test.TaskOptions')
    subgraph = find_isolate.CreateGraph(options.build_options)
    find_isolate_tasks = [
        task for task in subgraph.vertices
        if task.vertex_type == 'find_isolate'
    ]
    assert len(find_isolate_tasks) == 1
    find_isolate_task = find_isolate_tasks[0]
    subgraph.vertices.extend([
        task_module.TaskVertex(id=TaskId(
            find_isolate.ChangeId(options.build_options.change), attempt),
                               vertex_type='run_test',
                               payload={
                                   'swarming_server': options.swarming_server,
                                   'dimensions': options.dimensions,
                                   'extra_args': options.extra_args,
                                   'change':
                                   options.build_options.change.AsDict(),
                                   'index': attempt,
                               }) for attempt in range(options.attempts)
    ])
    subgraph.edges.extend([
        task_module.Dependency(from_=task.id, to=find_isolate_task.id)
        for task in subgraph.vertices if task.vertex_type == 'run_test'
    ])
    return subgraph
Beispiel #2
0
 def GenerateVertexAndDep(attempts):
     for attempt in range(attempts):
         change_id = find_isolate.ChangeId(
             options.test_options.build_options.change)
         read_value_id = 'read_value_%s_%s' % (change_id, attempt)
         run_test_id = run_test.TaskId(change_id, attempt)
         yield (task_module.TaskVertex(
             id=read_value_id,
             vertex_type='read_value',
             payload={
                 'benchmark': options.benchmark,
                 'mode': options.mode,
                 'results_filename': path,
                 'histogram_options': {
                     'grouping_label':
                     options.histogram_options.grouping_label,
                     'story': options.histogram_options.story,
                     'statistic': options.histogram_options.statistic,
                 },
                 'graph_json_options': {
                     'chart': options.graph_json_options.chart,
                     'trace': options.graph_json_options.trace
                 },
                 'change':
                 options.test_options.build_options.change.AsDict(),
                 'index': attempt,
             }), task_module.Dependency(from_=read_value_id,
                                        to=run_test_id))