diff --git a/CHANGELOG.md b/CHANGELOG.md index 21ba5a533fac269ee7d5fa59dbac667736c01431..395df0e5840cbefd020da6f493410419c1236993 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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: diff --git a/src/ewoksppf/__init__.py b/src/ewoksppf/__init__.py index 533d66672b7f7fe5f0934de20b494128017b3647..e72f220a0d0c1d7e2361c0f7de7397206143bff4 100644 --- a/src/ewoksppf/__init__.py +++ b/src/ewoksppf/__init__.py @@ -1,3 +1,3 @@ from .bindings import execute_graph # noqa: F401 -__version__ = "0.1.2" +__version__ = "0.1.3" diff --git a/src/ewoksppf/bindings.py b/src/ewoksppf/bindings.py index 79fa53bc773b54246c8e6f33102bb586a4414578..6a96ef97cd837c549714322f9cd76a0d1800de39 100644 --- a/src/ewoksppf/bindings.py +++ b/src/ewoksppf/bindings.py @@ -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: diff --git a/src/ewoksppf/tests/test_examples.py b/src/ewoksppf/tests/test_examples.py index c1a2322b3cc5a61083517664ece5b71d9585bcd7..73956aae8d250d02d015d9773e50d35d4aa9cad5 100644 --- a/src/ewoksppf/tests/test_examples.py +++ b/src/ewoksppf/tests/test_examples.py @@ -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) diff --git a/src/ewoksppf/tests/test_ppf_end.py b/src/ewoksppf/tests/test_ppf_end.py index aab3dba04c3d61284a62a96e930ce1f951f2a466..4b0e8d4182cc50060b5b8dc36831b3a8d518f611 100644 --- a/src/ewoksppf/tests/test_ppf_end.py +++ b/src/ewoksppf/tests/test_ppf_end.py @@ -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 diff --git a/src/ewoksppf/tests/test_ppf_workflow1.py b/src/ewoksppf/tests/test_ppf_workflow1.py index 8130ab50b75715ac15579758d835db1257af9257..c1e36a0af9d75e1d033905405336cd6fe85de8e8 100644 --- a/src/ewoksppf/tests/test_ppf_workflow1.py +++ b/src/ewoksppf/tests/test_ppf_workflow1.py @@ -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) diff --git a/src/ewoksppf/tests/test_ppf_workflow10.py b/src/ewoksppf/tests/test_ppf_workflow10.py index b6d00f99f031892ff486d314d7203d7526f4212f..8b10e2fbd0db15df57878b37bafc7446ab95d52c 100644 --- a/src/ewoksppf/tests/test_ppf_workflow10.py +++ b/src/ewoksppf/tests/test_ppf_workflow10.py @@ -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: diff --git a/src/ewoksppf/tests/test_ppf_workflow11.py b/src/ewoksppf/tests/test_ppf_workflow11.py index c74f1a8027800e1501b35c1c352e4c223cf21a66..c799d884a4120deaf4106edecd86afc960bfa15c 100644 --- a/src/ewoksppf/tests/test_ppf_workflow11.py +++ b/src/ewoksppf/tests/test_ppf_workflow11.py @@ -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) diff --git a/src/ewoksppf/tests/test_ppf_workflow12.py b/src/ewoksppf/tests/test_ppf_workflow12.py index 92d581f2b13f581ec4a7997730c7752543ceeee8..8d294f943c5482b108e9814a75ee4b5ab5557c06 100644 --- a/src/ewoksppf/tests/test_ppf_workflow12.py +++ b/src/ewoksppf/tests/test_ppf_workflow12.py @@ -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) diff --git a/src/ewoksppf/tests/test_ppf_workflow13.py b/src/ewoksppf/tests/test_ppf_workflow13.py index fa2833c913140985750950d0d52564d8955d70f5..118ddf2bc84b2cd7cd5f601de276d3de299e63ac 100644 --- a/src/ewoksppf/tests/test_ppf_workflow13.py +++ b/src/ewoksppf/tests/test_ppf_workflow13.py @@ -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) diff --git a/src/ewoksppf/tests/test_ppf_workflow14.py b/src/ewoksppf/tests/test_ppf_workflow14.py index 8ca76a0436b5b2bde280c312557f2f6dcc3fb801..9839a68c420c6a8765cc7b1f1f1282818f08c286 100644 --- a/src/ewoksppf/tests/test_ppf_workflow14.py +++ b/src/ewoksppf/tests/test_ppf_workflow14.py @@ -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) diff --git a/src/ewoksppf/tests/test_ppf_workflow15.py b/src/ewoksppf/tests/test_ppf_workflow15.py index 08f0c7f1106d05a94acd11c0b0c9645eee312a28..9da4bcad27cb3caff48b65c475005ed9c7552063 100644 --- a/src/ewoksppf/tests/test_ppf_workflow15.py +++ b/src/ewoksppf/tests/test_ppf_workflow15.py @@ -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) diff --git a/src/ewoksppf/tests/test_ppf_workflow16.py b/src/ewoksppf/tests/test_ppf_workflow16.py index 9a49b5560a2898f6845adf058402fbf2269b3d99..9c783cd09b1a2bdf3d338f78bbc7f7d22205dffc 100644 --- a/src/ewoksppf/tests/test_ppf_workflow16.py +++ b/src/ewoksppf/tests/test_ppf_workflow16.py @@ -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) diff --git a/src/ewoksppf/tests/test_ppf_workflow17.py b/src/ewoksppf/tests/test_ppf_workflow17.py index f476d3386e674492de3d916b59c79cd5e9bd641d..f432a5a6816bb33076076ac56ef1798faf3aa658 100644 --- a/src/ewoksppf/tests/test_ppf_workflow17.py +++ b/src/ewoksppf/tests/test_ppf_workflow17.py @@ -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 diff --git a/src/ewoksppf/tests/test_ppf_workflow18.py b/src/ewoksppf/tests/test_ppf_workflow18.py index f09d5c0e0c78834450cbd7058a6582f1525b2194..9b454488da143a4889e0a3005c6b7f2d3d99c4e0 100644 --- a/src/ewoksppf/tests/test_ppf_workflow18.py +++ b/src/ewoksppf/tests/test_ppf_workflow18.py @@ -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) diff --git a/src/ewoksppf/tests/test_ppf_workflow19.py b/src/ewoksppf/tests/test_ppf_workflow19.py index 5f7b537cef563ca76269c35b8147b3f2c0e38779..d30ea24d0fcec07a1ef5e2e1f031ddb1a977cdc5 100644 --- a/src/ewoksppf/tests/test_ppf_workflow19.py +++ b/src/ewoksppf/tests/test_ppf_workflow19.py @@ -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) diff --git a/src/ewoksppf/tests/test_ppf_workflow2.py b/src/ewoksppf/tests/test_ppf_workflow2.py index e5d2e5e12b51481b9d4aae39652d4205cef1676e..c69f7f577effbbcf4f405551ef7e00876b118621 100644 --- a/src/ewoksppf/tests/test_ppf_workflow2.py +++ b/src/ewoksppf/tests/test_ppf_workflow2.py @@ -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 diff --git a/src/ewoksppf/tests/test_ppf_workflow20.py b/src/ewoksppf/tests/test_ppf_workflow20.py index 53224f883d24c56a46f86beff65091912313cc33..4175121d3894251c86ec45d9afeaf408797fd8a7 100644 --- a/src/ewoksppf/tests/test_ppf_workflow20.py +++ b/src/ewoksppf/tests/test_ppf_workflow20.py @@ -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) diff --git a/src/ewoksppf/tests/test_ppf_workflow21.py b/src/ewoksppf/tests/test_ppf_workflow21.py index 0d25c07245e0d5a0212f03cf9acb8590b33c8ee4..1dde3f7eb80e596dcb1057136f43f5222995ecf3 100644 --- a/src/ewoksppf/tests/test_ppf_workflow21.py +++ b/src/ewoksppf/tests/test_ppf_workflow21.py @@ -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"] diff --git a/src/ewoksppf/tests/test_ppf_workflow22.py b/src/ewoksppf/tests/test_ppf_workflow22.py index 373f739c930a20fd324096ea4b5fed8de231024b..0440c2e16a10c1847376fcda9d836824cc2ecdff 100644 --- a/src/ewoksppf/tests/test_ppf_workflow22.py +++ b/src/ewoksppf/tests/test_ppf_workflow22.py @@ -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) diff --git a/src/ewoksppf/tests/test_ppf_workflow23.py b/src/ewoksppf/tests/test_ppf_workflow23.py index 03612f570cc53f254886f71793a35e93c70353b9..bc8904407cd293532f6cabcce582e3f3bc498272 100644 --- a/src/ewoksppf/tests/test_ppf_workflow23.py +++ b/src/ewoksppf/tests/test_ppf_workflow23.py @@ -96,7 +96,5 @@ def test_ppf_workflow23(on_error, ppf_log_config, tmpdir): {"name": "groups", "value": set()}, ] varinfo = {"root_uri": str(tmpdir)} - result = execute_graph( - graph, inputs=inputs, varinfo=varinfo, outputs=[{"all": True}] - ) + result = execute_graph(graph, inputs=inputs, varinfo=varinfo) assert_execute_graph_default_result(graph, result, expected, varinfo=varinfo) diff --git a/src/ewoksppf/tests/test_ppf_workflow24.py b/src/ewoksppf/tests/test_ppf_workflow24.py index b519ba12ac6fc879e100b4522a4236076695028c..089e6940d14a94165b1e9dda592c0b80becfe484 100644 --- a/src/ewoksppf/tests/test_ppf_workflow24.py +++ b/src/ewoksppf/tests/test_ppf_workflow24.py @@ -159,9 +159,7 @@ def test_ppf_workflow24(ppf_log_config): {"name": "succeeded", "value": tuple()}, {"name": "raise_on_names", "value": tuple()}, ] - result = execute_graph( - workflow(), inputs=inputs, raise_on_error=False, outputs=[{"all": True}] - ) + result = execute_graph(workflow(), inputs=inputs, raise_on_error=False) succeeded = "task1", "task2", "task3" assert result["_ppfdict"]["succeeded"] == succeeded assert "WorkflowException" not in result["_ppfdict"] @@ -170,9 +168,7 @@ def test_ppf_workflow24(ppf_log_config): {"name": "succeeded", "value": tuple()}, {"name": "raise_on_names", "value": ("task3",)}, ] - result = execute_graph( - workflow(), inputs=inputs, raise_on_error=False, outputs=[{"all": True}] - ) + result = execute_graph(workflow(), inputs=inputs, raise_on_error=False) succeeded = "task1", "task2", "subtask1", "subtask2", "subtask3" assert result["_ppfdict"]["succeeded"] == succeeded errorMessage = result["_ppfdict"]["WorkflowException"]["errorMessage"] @@ -182,9 +178,7 @@ def test_ppf_workflow24(ppf_log_config): {"name": "succeeded", "value": tuple()}, {"name": "raise_on_names", "value": ("task3", "subtask2")}, ] - result = execute_graph( - workflow(), inputs=inputs, raise_on_error=False, outputs=[{"all": True}] - ) + result = execute_graph(workflow(), inputs=inputs, raise_on_error=False) succeeded = ( "task1", "task2", @@ -201,9 +195,7 @@ def test_ppf_workflow24(ppf_log_config): {"name": "succeeded", "value": tuple()}, {"name": "raise_on_names", "value": ("task3", "subtask3", "subsubtask1")}, ] - result = execute_graph( - workflow(), inputs=inputs, raise_on_error=False, outputs=[{"all": True}] - ) + result = execute_graph(workflow(), inputs=inputs, raise_on_error=False) succeeded = "task1", "task2", "subtask1", "subtask2", "subsub_handler" assert result["_ppfdict"]["succeeded"] == succeeded errorMessage = result["_ppfdict"]["WorkflowException"]["errorMessage"] diff --git a/src/ewoksppf/tests/test_ppf_workflow3.py b/src/ewoksppf/tests/test_ppf_workflow3.py index a5bd6a6537c495d9806ea8d1cc3f6f870becf0b1..7092c7892e545976eab932e5580696076f773fb8 100644 --- a/src/ewoksppf/tests/test_ppf_workflow3.py +++ b/src/ewoksppf/tests/test_ppf_workflow3.py @@ -76,5 +76,5 @@ def workflow3(): def test_workflow3(ppf_log_config, tmpdir): varinfo = {"root_uri": str(tmpdir)} graph, expected = workflow3() - 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) diff --git a/src/ewoksppf/tests/test_ppf_workflow6.py b/src/ewoksppf/tests/test_ppf_workflow6.py index 89d4fe0c98c396ded92fa262c5dae1187fb8561a..3714db06e873c5e551a16f8ca3391ab6b9ca05bb 100644 --- a/src/ewoksppf/tests/test_ppf_workflow6.py +++ b/src/ewoksppf/tests/test_ppf_workflow6.py @@ -85,5 +85,5 @@ def workflow6(): def test_workflow6(ppf_log_config, tmpdir): varinfo = {"root_uri": str(tmpdir)} graph, expected = workflow6() - 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) diff --git a/src/ewoksppf/tests/test_ppf_workflow7.py b/src/ewoksppf/tests/test_ppf_workflow7.py index 9dcde4b538123c1a095f9be1625ee6c95a4ddc5e..6e8f45ebc64c72c469b4eaca4989c38914eb1ae4 100644 --- a/src/ewoksppf/tests/test_ppf_workflow7.py +++ b/src/ewoksppf/tests/test_ppf_workflow7.py @@ -71,5 +71,5 @@ def workflow7(): def test_workflow7(ppf_log_config, tmpdir): varinfo = {"root_uri": str(tmpdir)} graph, expected = workflow7() - 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) diff --git a/src/ewoksppf/tests/test_ppf_workflow8.py b/src/ewoksppf/tests/test_ppf_workflow8.py index 959eecfe393803e620846d52a4d3b3b1c27131a3..f2009fadcc691f41ebe97034e0daf613dbb684f0 100644 --- a/src/ewoksppf/tests/test_ppf_workflow8.py +++ b/src/ewoksppf/tests/test_ppf_workflow8.py @@ -71,5 +71,5 @@ def workflow8(): def test_workflow8(ppf_log_config, tmpdir): varinfo = {"root_uri": str(tmpdir)} graph, expected = workflow8() - 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) diff --git a/src/ewoksppf/tests/test_ppf_workflow9.py b/src/ewoksppf/tests/test_ppf_workflow9.py index e5342da80078cf7863577fcb11e112a560ca90ef..65c777a1fb69813ab3384d807fc28c0f2e18aeda 100644 --- a/src/ewoksppf/tests/test_ppf_workflow9.py +++ b/src/ewoksppf/tests/test_ppf_workflow9.py @@ -58,5 +58,5 @@ def workflow9(): def test_workflow9(ppf_log_config, tmpdir): varinfo = {"root_uri": str(tmpdir)} graph, expected = workflow9() - 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)