Skip to content
Snippets Groups Projects
Commit b9babcf2 authored by Wout De Nolf's avatar Wout De Nolf
Browse files

Merge branch 'release' into 'main'

Release

See merge request !85
parents b16f2c1f 0e687b14
No related branches found
Tags v0.1.3
1 merge request!85Release
Pipeline #114473 passed
Showing
with 29 additions and 27 deletions
......@@ -2,6 +2,11 @@
## 0.2.0 (unreleased)
## 0.1.3
Bug fixes:
- fix "outputs" argument default of execute_graph
## 0.1.2
Bug fixes:
......
from .bindings import execute_graph # noqa: F401
__version__ = "0.1.2"
__version__ = "0.1.3"
......@@ -527,9 +527,13 @@ class EwoksWorkflow(Workflow):
timeout: Optional[float] = None,
**execute_options,
):
if outputs and (outputs != [{"all": True}] or not merge_outputs):
if outputs is None:
outputs = [{"all": False}]
# TODO: pypushflow returns the values of the last task that was
# executed, not all end nodes as is expected here
if outputs and (outputs != [{"all": False}] or not merge_outputs):
raise ValueError(
"the Pypushflow engine can only return the merged results of all tasks"
"the Pypushflow engine can only return the merged results of end tasks"
)
self._stop_actor.reset()
with self._run_context(**execute_options) as execinfo:
......
......@@ -15,5 +15,5 @@ def test_execute_graph(graph_name, scheme, ppf_log_config, tmpdir):
else:
varinfo = None
ewoksgraph = load_graph(graph)
result = execute_graph(graph, varinfo=varinfo, timeout=10, outputs=[{"all": True}])
result = execute_graph(graph, varinfo=varinfo, timeout=10)
assert_execute_graph_default_result(ewoksgraph, result, expected, varinfo)
......@@ -58,6 +58,6 @@ def workflow():
def test_ppf_end(ppf_log_config):
graph, expected = workflow()
result = execute_graph(graph, outputs=[{"all": True}])
result = execute_graph(graph)
for k, v in expected.items():
assert result[k] == v, k
......@@ -30,5 +30,5 @@ def workflow1():
def test_workflow1(ppf_log_config, tmpdir):
varinfo = {"root_uri": str(tmpdir)}
graph, expected = workflow1()
result = execute_graph(graph, varinfo=varinfo, outputs=[{"all": True}])
result = execute_graph(graph, varinfo=varinfo)
assert_execute_graph_default_result(graph, result, expected, varinfo)
......@@ -57,7 +57,7 @@ def test_workflow10(limit, scheme, ppf_log_config, tmpdir):
varinfo = {}
inputs = {"value": 1, "limit": limit}
graph, expected = workflow10(inputs)
result = execute_graph(graph, varinfo=varinfo, outputs=[{"all": True}])
result = execute_graph(graph, varinfo=varinfo)
if scheme:
assert_execute_graph_values(result, expected, varinfo)
else:
......
......@@ -132,5 +132,5 @@ def workflow11():
def test_workflow11(ppf_log_config, tmpdir):
varinfo = {"root_uri": str(tmpdir)}
graph, expected = workflow11()
result = execute_graph(graph, varinfo=varinfo, outputs=[{"all": True}])
result = execute_graph(graph, varinfo=varinfo)
assert_execute_graph_default_result(graph, result, expected, varinfo=varinfo)
......@@ -95,5 +95,5 @@ def test_workflow12(startvalue, ppf_log_config, tmpdir):
withsubmodel_startvalue = 1
varinfo = {"root_uri": str(tmpdir)}
graph, expected = workflow12(startvalue, withsubmodel_startvalue)
result = execute_graph(graph, varinfo=varinfo, outputs=[{"all": True}])
result = execute_graph(graph, varinfo=varinfo)
assert_execute_graph_default_result(graph, result, expected, varinfo=varinfo)
......@@ -92,5 +92,5 @@ def test_workflow13(startvalue, ppf_log_config, tmpdir):
withlastnode_startvalue = 1
varinfo = {"root_uri": str(tmpdir)}
graph, expected = workflow13(startvalue, withlastnode_startvalue)
result = execute_graph(graph, varinfo=varinfo, outputs=[{"all": True}])
result = execute_graph(graph, varinfo=varinfo)
assert_execute_graph_default_result(graph, result, expected, varinfo=varinfo)
......@@ -118,5 +118,5 @@ def workflow14():
def test_workflow14(ppf_log_config, tmpdir):
varinfo = {"root_uri": str(tmpdir)}
graph, expected = workflow14()
result = execute_graph(graph, varinfo=varinfo, outputs=[{"all": True}])
result = execute_graph(graph, varinfo=varinfo)
assert_execute_graph_default_result(graph, result, expected, varinfo=varinfo)
......@@ -106,5 +106,5 @@ def test_workflow15(ppf_log_config, tmpdir):
"""Test connecting nodes from submodels directly"""
varinfo = {"root_uri": str(tmpdir)}
graph, expected = workflow15()
result = execute_graph(graph, varinfo=varinfo, outputs=[{"all": True}])
result = execute_graph(graph, varinfo=varinfo)
assert_execute_graph_default_result(graph, result, expected, varinfo=varinfo)
......@@ -135,5 +135,5 @@ def test_workflow16(ppf_log_config, tmpdir):
"""Test connecting nodes from sub-submodels to the top model"""
varinfo = {"root_uri": str(tmpdir)}
graph, expected = workflow16()
result = execute_graph(graph, varinfo=varinfo, outputs=[{"all": True}])
result = execute_graph(graph, varinfo=varinfo)
assert_execute_graph_default_result(graph, result, expected, varinfo=varinfo)
......@@ -50,6 +50,6 @@ def workflow17(doloop=True):
def test_workflow17(doloop, ppf_log_config):
"""Test 2 unconditional upstream tasks, one coming from a feedback loop"""
graph, expected = workflow17(doloop=doloop)
result = execute_graph(graph, outputs=[{"all": True}])
result = execute_graph(graph)
for k, v in expected.items():
assert result[k] == v, k
......@@ -50,5 +50,5 @@ def test_workflow18(dotask4, ppf_log_config, tmpdir):
"""Test conditional links"""
varinfo = {"root_uri": str(tmpdir)}
graph, expected = workflow18(dotask4=dotask4)
result = execute_graph(graph, varinfo=varinfo, outputs=[{"all": True}])
result = execute_graph(graph, varinfo=varinfo)
assert_execute_graph_default_result(graph, result, expected, varinfo=varinfo)
......@@ -77,5 +77,5 @@ def test_workflow19(ppf_log_config, tmpdir):
"""Test 2 unconditional upstream tasks, one coming from a feedback loop"""
varinfo = {"root_uri": str(tmpdir)}
graph, expected = workflow19()
result = execute_graph(graph, outputs=[{"all": True}])
result = execute_graph(graph)
assert_execute_graph_default_result(graph, result, expected, varinfo=varinfo)
......@@ -29,9 +29,7 @@ def workflow2():
def test_workflow2(ppf_log_config, tmpdir):
varinfo = {"root_uri": str(tmpdir)}
graph, expected = workflow2()
result = execute_graph(
graph, varinfo=varinfo, raise_on_error=False, outputs=[{"all": True}]
)
result = execute_graph(graph, varinfo=varinfo, raise_on_error=False)
assert_execute_graph_default_result(graph, result, expected, varinfo=varinfo)
err_msg = "Task 'Python Error Handler Test' failed"
assert result["WorkflowException"]["errorMessage"] == err_msg
......@@ -29,10 +29,7 @@ def test_workflow20(persist, ppf_log_config, tmpdir):
varinfo = None
graph = workflow20()
result = execute_graph(
graph,
inputs=[{"name": "value", "value": 5}],
varinfo=varinfo,
outputs=[{"all": True}],
graph, inputs=[{"name": "value", "value": 5}], varinfo=varinfo
)
expected = {"_ppfdict": {"value": 7}}
assert_execute_graph_default_result(graph, result, expected, varinfo=varinfo)
......@@ -168,9 +168,7 @@ def test_workflow21(args, on_error, persist, ppf_log_config, tmpdir):
varinfo = None
graph = workflow21(on_error=on_error)
inputs = [{"name": k, "value": v} for k, v in args["inputs"].items()]
result = execute_graph(
graph, inputs=inputs, varinfo=varinfo, outputs=[{"all": True}]
)
result = execute_graph(graph, inputs=inputs, varinfo=varinfo)
assert result
assert result["return_value"] == args["return_value"]
......
......@@ -97,5 +97,5 @@ def test_ppf_workflow22(ppf_log_config, tmpdir):
graph, expected = workflow()
varinfo = {"root_uri": str(tmpdir)}
result = execute_graph(graph, varinfo=varinfo, outputs=[{"all": True}])
result = execute_graph(graph, varinfo=varinfo)
assert_execute_graph_default_result(graph, result, expected, varinfo=varinfo)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment