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'}
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
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
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()
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()
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'}
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()
def test_parallel(dg): dg.add_path(['t1', 't3', 't4', 't5']) dg.add_path(['t2', 't3']) assert set(traverse(dg)) == {'t1', 't2'}