예제 #1
0
def test_walked_only_when_all_predecessors_visited(dg):
    dg.add_path(['t1', 't3', 't4', 't5'])
    dg.add_path(['t2', 't3'])

    dg.node['t1']['status'] = 'SUCCESS'
    dg.node['t2']['status'] = 'INPROGRESS'

    assert set(traverse(dg)) == set()

    dg.node['t2']['status'] = 'SUCCESS'

    assert set(traverse(dg)) == {'t3'}
예제 #2
0
 def _next(self, plan):
     tasks = traverse(plan)
     filtered_tasks = list(
         limits.get_default_chain(plan, [
             t for t in plan
             if plan.node[t]['status'] == states.INPROGRESS.name
         ], tasks))
     return filtered_tasks
예제 #3
0
파일: scheduler.py 프로젝트: loles/solar-1
 def _next(self, plan):
     tasks = traverse(plan)
     filtered_tasks = list(limits.get_default_chain(
         plan,
         [t for t in plan
          if plan.node[t]['status'] == states.INPROGRESS.name],
         tasks))
     return filtered_tasks
예제 #4
0
def schedule(plan_uid, dg):
    tasks = traverse(dg)
    limit_chain = limits.get_default_chain(
        dg, [t for t in dg if dg.node[t]['status'] == 'INPROGRESS'], tasks)
    execution = executor.celery_executor(dg,
                                         limit_chain,
                                         control_tasks=('fault_tolerance', ))
    graph.save_graph(dg)
    execution()
예제 #5
0
파일: tasks.py 프로젝트: rustyrobot/solar
def schedule(plan_uid, dg):
    tasks = traverse(dg)
    limit_chain = limits.get_default_chain(
        dg,
        [t for t in dg if dg.node[t]['status'] == 'INPROGRESS'],
        tasks)
    execution = executor.celery_executor(
        dg, limit_chain, control_tasks=('fault_tolerance',))
    graph.save_graph(dg)
    execution()
예제 #6
0
def test_node_will_be_walked_if_parent_is_noop(dg):
    dg.add_path(['t1', 't2', 't3', 't4', 't5'])
    dg.node['t1']['status'] = 'NOOP'

    assert set(traverse(dg)) == {'t2'}
예제 #7
0
def test_nothing_will_be_walked_if_parent_is_skipped(dg):
    dg.add_path(['t1', 't2', 't3', 't4', 't5'])
    dg.node['t1']['status'] = 'SKIPPED'

    assert set(traverse(dg)) == set()
예제 #8
0
def test_parallel(dg):
    dg.add_path(['t1', 't3', 't4', 't5'])
    dg.add_path(['t2', 't3'])

    assert set(traverse(dg)) == {'t1', 't2'}