Ejemplo n.º 1
0
 def test_file_inputs_python(self):
     mock = tasks.file_python_inputs_mock
     h = ExecutionHandler()
     _task = OrcaTask(mock, h.resolve_task_inputs(mock))
     h.handle_python(_task)
     assert 'result' in _task.locals
     assert _task.locals['result'] == 25
Ejemplo n.º 2
0
 def test_inline_python(self):
     mock = tasks.inline_python_mock
     h = ExecutionHandler()
     _task = OrcaTask(mock, h.resolve_task_inputs(mock))
     h.handle_python(_task)
     assert 'greeting' in _task.locals
     assert _task.locals['greeting'] == 'Hello World'
Ejemplo n.º 3
0
def run(ledger_json, ledger_mongo, ledger_kafka, file, args):
    """
    Run an orca workflow.
    """
    try:
        ledger = None
        if ledger_json:
            ledger = JSONFileLedger(ledger_json)
        elif ledger_mongo:
            ledger = MongoLedger(ledger_mongo)
        elif ledger_kafka:
            ledger = KafkaLedger(ledger_kafka)

        config = OrcaConfig.create(file, args)
        executor = ExecutionHandler(ledger)
        executor.handle(config)
    except OrcaError as e:
        log.error(e)
Ejemplo n.º 4
0
 def test_comprehensive_example(self):
     run_handler('datetime.yaml', ExecutionHandler())
Ejemplo n.º 5
0
 def test_bad_python_func(self):
     with self.assertRaises(ExecutionError):
         run_handler('bad_python_func.yaml', ExecutionHandler())
Ejemplo n.º 6
0
 def test_python_func(self):
     run_handler('python_funcs.yaml', ExecutionHandler())
Ejemplo n.º 7
0
 def test_var4_task(self):
     run_handler('var4.yaml', ExecutionHandler())
Ejemplo n.º 8
0
 def test_switch_task(self):
     run_handler('switch.yaml', ExecutionHandler())
Ejemplo n.º 9
0
 def test_for_task(self):
     run_handler('for.yaml', ExecutionHandler())
Ejemplo n.º 10
0
 def test_csip_task(self):
     run_handler('csip.yaml', ExecutionHandler())
Ejemplo n.º 11
0
 def test_inline_bash_task(self):
     run_handler('bash-inline.yaml', ExecutionHandler())
Ejemplo n.º 12
0
 def test_simple_python(self):
     run_handler('python.yaml', ExecutionHandler())
Ejemplo n.º 13
0
 def test_imports_example(self):
     run_handler('imports.yaml', ExecutionHandler())