You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ariatosca.apache.org by mx...@apache.org on 2017/12/04 10:37:22 UTC

[incubator-ariatosca] branch ARIA-414-Current-events-handler-mechanism-relies-on-sqlalchemy updated (7b1470d -> 895c539)

This is an automated email from the ASF dual-hosted git repository.

mxmrlv pushed a change to branch ARIA-414-Current-events-handler-mechanism-relies-on-sqlalchemy
in repository https://gitbox.apache.org/repos/asf/incubator-ariatosca.git.


    omit 7b1470d  fixed linting
    omit c77c0e4  ARIA-414 Current events handler mechanism relies on sqlalchemy
     add 3c662b8  ARIA-1 Parser test suite
     new 895c539  ARIA-414 Current events handler mechanism relies on sqlalchemy

This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version.  This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:

 * -- * -- B -- O -- O -- O   (7b1470d)
            \
             N -- N -- N   refs/heads/ARIA-414-Current-events-handler-mechanism-relies-on-sqlalchemy (895c539)

You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.

Any revisions marked "omit" are not gone; other references still
refer to them.  Any revisions marked "discard" are gone forever.

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .travis.yml                                        |  22 +-
 Makefile                                           |   3 +
 README.rst                                         |  53 +-
 appveyor.yml                                       |   1 +
 aria/__init__.py                                   |  21 +-
 aria/cli/commands/services.py                      |   2 +-
 aria/cli/utils.py                                  |   4 +-
 aria/modeling/functions.py                         |   2 +-
 aria/modeling/mixins.py                            |   4 +-
 aria/modeling/orchestration.py                     |   2 +-
 aria/modeling/service_common.py                    |   8 +-
 aria/modeling/service_instance.py                  |   4 +-
 aria/modeling/service_template.py                  |   4 +-
 aria/modeling/utils.py                             |   2 +-
 aria/orchestrator/context/common.py                |   6 +-
 aria/orchestrator/context/operation.py             |  12 +-
 aria/orchestrator/context/workflow.py              |   4 +-
 aria/orchestrator/decorators.py                    |   2 +-
 aria/orchestrator/execution_plugin/common.py       |  12 +-
 .../execution_plugin/ctx_proxy/client.py           |   4 +-
 .../execution_plugin/ctx_proxy/server.py           |  10 +-
 .../orchestrator/execution_plugin/instantiation.py |  20 +-
 aria/orchestrator/execution_plugin/local.py        |   4 +-
 .../execution_plugin/ssh/operations.py             |  46 +-
 aria/orchestrator/execution_plugin/ssh/tunnel.py   |   4 +-
 aria/orchestrator/plugin.py                        |  12 +-
 aria/orchestrator/topology/instance_handler.py     | 106 +--
 aria/orchestrator/topology/template_handler.py     |  91 +-
 aria/orchestrator/topology/topology.py             |  10 +-
 aria/orchestrator/workflows/api/task.py            |  10 +-
 aria/orchestrator/workflows/api/task_graph.py      |   8 +-
 .../workflows/builtin/execute_operation.py         |   2 +-
 aria/orchestrator/workflows/core/engine.py         |   2 +-
 aria/orchestrator/workflows/core/events_handler.py |   4 +-
 aria/orchestrator/workflows/core/graph_compiler.py |   4 +-
 aria/orchestrator/workflows/events_logging.py      |  18 +-
 aria/orchestrator/workflows/exceptions.py          |   8 +-
 aria/orchestrator/workflows/executor/celery.py     |   2 +-
 aria/orchestrator/workflows/executor/dry.py        |   2 +-
 aria/orchestrator/workflows/executor/process.py    |   8 +-
 aria/orchestrator/workflows/executor/thread.py     |   2 +-
 aria/parser/consumption/context.py                 |   6 +-
 aria/parser/consumption/inputs.py                  |   2 +-
 aria/parser/consumption/presentation.py            | 275 +++++--
 aria/parser/consumption/validation.py              |   2 +-
 aria/parser/loading/file.py                        |  18 +-
 aria/parser/loading/literal.py                     |   3 +
 aria/parser/loading/loader.py                      |  13 +-
 aria/parser/loading/location.py                    |  27 +-
 aria/parser/loading/request.py                     |  20 +-
 aria/parser/loading/uri.py                         |  47 +-
 aria/parser/presentation/__init__.py               |  14 +-
 aria/parser/presentation/context.py                |  23 +-
 aria/parser/presentation/field_validators.py       |  23 +-
 aria/parser/presentation/fields.py                 | 125 +--
 aria/parser/presentation/presentation.py           |  15 +-
 aria/parser/presentation/presenter.py              |   8 +-
 aria/parser/presentation/source.py                 |   2 +-
 aria/parser/presentation/utils.py                  |  28 +-
 aria/parser/reading/__init__.py                    |   5 +-
 aria/parser/reading/context.py                     |   3 -
 aria/parser/reading/exceptions.py                  |   6 -
 aria/parser/reading/jinja.py                       |   4 +-
 aria/parser/reading/json.py                        |   2 +-
 aria/parser/reading/locator.py                     |  20 +-
 aria/parser/reading/reader.py                      |  11 +-
 aria/parser/reading/source.py                      |   4 +-
 aria/parser/reading/yaml.py                        |  51 +-
 aria/parser/specification.py                       |   2 +-
 aria/parser/validation/issue.py                    |  22 +-
 aria/storage/filesystem_rapi.py                    |   4 +-
 aria/utils/caching.py                              |   2 +-
 aria/utils/collections.py                          |  56 +-
 aria/utils/formatting.py                           |   2 +-
 aria/utils/threading.py                            | 153 ++--
 aria/utils/uris.py                                 |   2 +-
 aria/utils/versions.py                             |   4 +-
 .../clearwater/clearwater-single-existing.yaml     |  12 +-
 examples/hello-world/hello-world.yaml              |  34 +-
 examples/hello-world/scripts/start.sh              |   2 +-
 .../use-cases/non-normative-types.yaml             |   2 +
 .../profiles/aria-1.0/aria-1.0.yaml                |   3 +
 .../profiles/tosca-simple-1.0/artifacts.yaml       |   8 +
 .../profiles/tosca-simple-1.0/capabilities.yaml    |  12 +
 .../profiles/tosca-simple-1.0/data.yaml            |  14 +
 .../profiles/tosca-simple-1.0/groups.yaml          |   1 +
 .../profiles/tosca-simple-1.0/interfaces.yaml      |   3 +
 .../profiles/tosca-simple-1.0/nodes.yaml           |  14 +
 .../profiles/tosca-simple-1.0/policies.yaml        |   5 +
 .../profiles/tosca-simple-1.0/relationships.yaml   |   8 +
 .../profiles/tosca-simple-nfv-1.0/artifacts.yaml   |   1 +
 .../tosca-simple-nfv-1.0/capabilities.yaml         |   3 +
 .../profiles/tosca-simple-nfv-1.0/data.yaml        |  10 +
 .../profiles/tosca-simple-nfv-1.0/nodes.yaml       |  25 +-
 .../tosca-simple-nfv-1.0/relationships.yaml        |   2 +
 .../simple_nfv_v1_0/presenter.py                   |   4 +-
 .../aria_extension_tosca/simple_v1_0/__init__.py   |  12 +-
 .../simple_v1_0/assignments.py                     |  30 +-
 .../aria_extension_tosca/simple_v1_0/data_types.py | 111 ++-
 .../simple_v1_0/definitions.py                     |  58 +-
 .../aria_extension_tosca/simple_v1_0/misc.py       |  18 +-
 .../simple_v1_0/modeling/__init__.py               |  64 +-
 .../simple_v1_0/modeling/capabilities.py           |  56 +-
 .../simple_v1_0/modeling/copy.py                   |   2 +-
 .../simple_v1_0/modeling/data_types.py             |  67 +-
 .../simple_v1_0/modeling/functions.py              | 135 +--
 .../simple_v1_0/modeling/groups.py                 |  43 +
 .../simple_v1_0/modeling/interfaces.py             | 160 ++--
 .../simple_v1_0/modeling/parameters.py             |  45 +-
 .../simple_v1_0/modeling/requirements.py           | 105 ++-
 .../simple_v1_0/modeling/substitution_mappings.py  |  51 +-
 .../simple_v1_0/presentation/extensible.py         |   2 +-
 .../simple_v1_0/presentation/field_getters.py      |  22 +-
 .../simple_v1_0/presentation/field_validators.py   | 142 ++--
 .../simple_v1_0/presentation/types.py              |   2 +-
 .../aria_extension_tosca/simple_v1_0/presenter.py  |   6 +-
 .../aria_extension_tosca/simple_v1_0/templates.py  |  23 +-
 .../aria_extension_tosca/simple_v1_0/types.py      |  52 +-
 requirements.in                                    |   3 +-
 requirements.txt                                   |  23 +-
 setup.py                                           |   4 +-
 tests/cli/test_node_templates.py                   |   2 +-
 tests/cli/test_nodes.py                            |   2 +-
 tests/cli/test_service_templates.py                |   2 +-
 tests/cli/test_services.py                         |   2 +-
 tests/end2end/test_hello_world.py                  |   4 +-
 tests/end2end/test_nodecellar.py                   |   2 +-
 .../__init__.py                                    |   0
 .../aria_extension_tosca}/__init__.py              |   0
 .../aria_extension_tosca/aria_v1_0}/__init__.py    |   0
 .../aria_extension_tosca/aria_v1_0/test_profile.py |  14 +-
 tests/extensions/aria_extension_tosca/conftest.py  |  48 ++
 .../simple_nfv_v1_0}/__init__.py                   |   0
 .../simple_nfv_v1_0/test_profile.py                |  12 +-
 .../aria_extension_tosca/simple_v1_0}/__init__.py  |   0
 .../aria_extension_tosca/simple_v1_0/data.py       |  82 ++
 .../simple_v1_0/functions}/__init__.py             |   0
 .../simple_v1_0/functions/test_function_concat.py  | 102 +++
 .../functions/test_function_get_artifact.py        | 156 ++++
 .../functions/test_function_get_input.py           |  94 +++
 .../functions/test_function_get_nodes_of_type.py   |  70 ++
 .../test_function_get_operation_output.py          |  84 ++
 .../simple_v1_0/functions/test_function_token.py   | 119 +++
 .../functions/test_functions_modelable_entity.py   | 247 ++++++
 .../simple_v1_0/templates}/__init__.py             |   0
 .../simple_v1_0/templates/common}/__init__.py      |   0
 .../simple_v1_0/templates/common/test_copy.py      |  68 ++
 .../templates/common/test_template_interface.py    | 914 +++++++++++++++++++++
 .../templates/common/test_template_parameters.py   | 781 ++++++++++++++++++
 .../common/test_template_parameters_properties.py  | 132 +++
 .../simple_v1_0/templates/common/test_templates.py | 128 +++
 .../templates/node_template}/__init__.py           |   0
 .../node_template/test_node_template_artifacts.py  | 307 +++++++
 .../node_template/test_node_template_directives.py |  77 ++
 .../test_node_template_node_filter_constraints.py  | 346 ++++++++
 .../test_node_template_node_filters.py             | 313 +++++++
 .../test_node_template_requirements.py             | 853 +++++++++++++++++++
 .../simple_v1_0/templates/test_group.py            | 159 ++++
 .../simple_v1_0/templates/test_policy.py           | 272 ++++++
 .../templates/test_substitution_mappings.py        | 449 ++++++++++
 .../templates/test_topology_template.py            |  61 ++
 .../simple_v1_0/test_dsl_definitions.py}           |  53 +-
 .../simple_v1_0/test_imports.py                    | 200 +++++
 .../simple_v1_0/test_metadata.py                   |  98 +++
 .../aria_extension_tosca/simple_v1_0/test_names.py |  57 ++
 .../simple_v1_0/test_profile.py                    |   9 +-
 .../simple_v1_0/test_repositories.py               | 179 ++++
 .../simple_v1_0/test_service_template.py           |  14 +-
 .../simple_v1_0/types}/__init__.py                 |   0
 .../simple_v1_0/types/common}/__init__.py          |   0
 .../types/common/test_type_interfaces.py           | 469 +++++++++++
 .../types/common/test_type_parameters.py           | 418 ++++++++++
 .../common/test_type_parameters_inheritance.py     | 114 +++
 .../common/test_type_parameters_properties.py      | 312 +++++++
 .../simple_v1_0/types/common/test_types.py         | 185 +++++
 .../simple_v1_0/types/node_type}/__init__.py       |   0
 .../types/node_type/test_node_type_capabilities.py | 302 +++++++
 .../test_node_type_relationship_interfaces.py}     |  56 +-
 .../types/node_type/test_node_type_requirements.py | 361 ++++++++
 .../simple_v1_0/types/test_artifact_type.py        |  74 ++
 .../simple_v1_0/types/test_capability_type.py      |  85 ++
 .../simple_v1_0/types/test_data_type.py            |  68 ++
 .../simple_v1_0/types/test_group_type.py           |  85 ++
 .../simple_v1_0/types/test_interface_type.py       | 149 ++++
 .../simple_v1_0/types/test_policy_type.py          | 123 +++
 .../simple_v1_0/types/test_relationship_type.py    |  85 ++
 tests/{utils => mechanisms}/__init__.py            |   0
 tests/mechanisms/parsing/__init__.py               |  81 ++
 tests/mechanisms/parsing/aria.py                   |  78 ++
 tests/mechanisms/utils.py                          |  80 ++
 tests/mechanisms/web_server.py                     |  84 ++
 tests/mock/workflow.py                             |   2 +-
 tests/modeling/__init__.py                         |   2 +-
 tests/orchestrator/context/test_operation.py       |   4 +-
 tests/orchestrator/context/test_serialize.py       |   3 +-
 tests/orchestrator/context/test_workflow.py        |   2 +-
 .../execution/test_execution_compiler.py           |   3 +-
 tests/orchestrator/execution_plugin/test_local.py  |   2 +-
 tests/orchestrator/execution_plugin/test_ssh.py    |   2 +-
 .../executor/test_process_executor_extension.py    |   2 +-
 .../test_process_executor_tracked_changes.py       |   6 +-
 .../presentation/__init__.py                       |   0
 .../presentation/test_types.py                     |  23 -
 tests/requirements.txt                             |   3 +-
 .../tosca-simple-1.0/node-cellar/node-cellar.yaml  |   8 +-
 .../types/shorthand-1/shorthand-1.yaml             |  23 -
 .../types/typequalified-1/typequalified-1.yaml     |  23 -
 tests/storage/test_model_storage.py                |   4 +-
 tests/test_extension.py                            |   4 +-
 tests/{utils => topology}/__init__.py              |   0
 tests/{parser => topology}/service_templates.py    |  16 -
 .../test_configuration.py                          |   3 +-
 .../test_end2end.py                                |   2 +-
 tests/{parser => topology}/test_reqs_caps.py       |   0
 tests/{parser => topology}/utils.py                |   2 +
 tests/utils/test_plugin.py                         |   2 +-
 tests/utils/test_versions.py                       |  10 +-
 tox.ini                                            |  41 +-
 218 files changed, 11556 insertions(+), 1305 deletions(-)
 create mode 100644 extensions/aria_extension_tosca/simple_v1_0/modeling/groups.py
 rename tests/{parser/test_tosca_simple_v1_0 => extensions}/__init__.py (100%)
 rename tests/{parser => extensions/aria_extension_tosca}/__init__.py (100%)
 rename tests/{instantiation => extensions/aria_extension_tosca/aria_v1_0}/__init__.py (100%)
 copy extensions/aria_extension_tosca/profiles/tosca-simple-1.0/tosca-simple-1.0.yaml => tests/extensions/aria_extension_tosca/aria_v1_0/test_profile.py (80%)
 create mode 100644 tests/extensions/aria_extension_tosca/conftest.py
 copy tests/{utils => extensions/aria_extension_tosca/simple_nfv_v1_0}/__init__.py (100%)
 copy aria/cli/exceptions.py => tests/extensions/aria_extension_tosca/simple_nfv_v1_0/test_profile.py (81%)
 copy tests/{utils => extensions/aria_extension_tosca/simple_v1_0}/__init__.py (100%)
 create mode 100644 tests/extensions/aria_extension_tosca/simple_v1_0/data.py
 copy tests/{utils => extensions/aria_extension_tosca/simple_v1_0/functions}/__init__.py (100%)
 create mode 100644 tests/extensions/aria_extension_tosca/simple_v1_0/functions/test_function_concat.py
 create mode 100644 tests/extensions/aria_extension_tosca/simple_v1_0/functions/test_function_get_artifact.py
 create mode 100644 tests/extensions/aria_extension_tosca/simple_v1_0/functions/test_function_get_input.py
 create mode 100644 tests/extensions/aria_extension_tosca/simple_v1_0/functions/test_function_get_nodes_of_type.py
 create mode 100644 tests/extensions/aria_extension_tosca/simple_v1_0/functions/test_function_get_operation_output.py
 create mode 100644 tests/extensions/aria_extension_tosca/simple_v1_0/functions/test_function_token.py
 create mode 100644 tests/extensions/aria_extension_tosca/simple_v1_0/functions/test_functions_modelable_entity.py
 copy tests/{utils => extensions/aria_extension_tosca/simple_v1_0/templates}/__init__.py (100%)
 copy tests/{utils => extensions/aria_extension_tosca/simple_v1_0/templates/common}/__init__.py (100%)
 create mode 100644 tests/extensions/aria_extension_tosca/simple_v1_0/templates/common/test_copy.py
 create mode 100644 tests/extensions/aria_extension_tosca/simple_v1_0/templates/common/test_template_interface.py
 create mode 100644 tests/extensions/aria_extension_tosca/simple_v1_0/templates/common/test_template_parameters.py
 create mode 100644 tests/extensions/aria_extension_tosca/simple_v1_0/templates/common/test_template_parameters_properties.py
 create mode 100644 tests/extensions/aria_extension_tosca/simple_v1_0/templates/common/test_templates.py
 copy tests/{utils => extensions/aria_extension_tosca/simple_v1_0/templates/node_template}/__init__.py (100%)
 create mode 100644 tests/extensions/aria_extension_tosca/simple_v1_0/templates/node_template/test_node_template_artifacts.py
 create mode 100644 tests/extensions/aria_extension_tosca/simple_v1_0/templates/node_template/test_node_template_directives.py
 create mode 100644 tests/extensions/aria_extension_tosca/simple_v1_0/templates/node_template/test_node_template_node_filter_constraints.py
 create mode 100644 tests/extensions/aria_extension_tosca/simple_v1_0/templates/node_template/test_node_template_node_filters.py
 create mode 100644 tests/extensions/aria_extension_tosca/simple_v1_0/templates/node_template/test_node_template_requirements.py
 create mode 100644 tests/extensions/aria_extension_tosca/simple_v1_0/templates/test_group.py
 create mode 100644 tests/extensions/aria_extension_tosca/simple_v1_0/templates/test_policy.py
 create mode 100644 tests/extensions/aria_extension_tosca/simple_v1_0/templates/test_substitution_mappings.py
 create mode 100644 tests/extensions/aria_extension_tosca/simple_v1_0/templates/test_topology_template.py
 copy tests/{resources/service-templates/tosca-simple-1.0/reqs_caps/reqs_caps1.yaml => extensions/aria_extension_tosca/simple_v1_0/test_dsl_definitions.py} (53%)
 create mode 100644 tests/extensions/aria_extension_tosca/simple_v1_0/test_imports.py
 create mode 100644 tests/extensions/aria_extension_tosca/simple_v1_0/test_metadata.py
 create mode 100644 tests/extensions/aria_extension_tosca/simple_v1_0/test_names.py
 copy aria/orchestrator/context/__init__.py => tests/extensions/aria_extension_tosca/simple_v1_0/test_profile.py (81%)
 create mode 100644 tests/extensions/aria_extension_tosca/simple_v1_0/test_repositories.py
 copy aria/cli/exceptions.py => tests/extensions/aria_extension_tosca/simple_v1_0/test_service_template.py (80%)
 copy tests/{utils => extensions/aria_extension_tosca/simple_v1_0/types}/__init__.py (100%)
 copy tests/{utils => extensions/aria_extension_tosca/simple_v1_0/types/common}/__init__.py (100%)
 create mode 100644 tests/extensions/aria_extension_tosca/simple_v1_0/types/common/test_type_interfaces.py
 create mode 100644 tests/extensions/aria_extension_tosca/simple_v1_0/types/common/test_type_parameters.py
 create mode 100644 tests/extensions/aria_extension_tosca/simple_v1_0/types/common/test_type_parameters_inheritance.py
 create mode 100644 tests/extensions/aria_extension_tosca/simple_v1_0/types/common/test_type_parameters_properties.py
 create mode 100644 tests/extensions/aria_extension_tosca/simple_v1_0/types/common/test_types.py
 copy tests/{utils => extensions/aria_extension_tosca/simple_v1_0/types/node_type}/__init__.py (100%)
 create mode 100644 tests/extensions/aria_extension_tosca/simple_v1_0/types/node_type/test_node_type_capabilities.py
 copy tests/{resources/service-templates/tosca-simple-1.0/reqs_caps/reqs_caps1.yaml => extensions/aria_extension_tosca/simple_v1_0/types/node_type/test_node_type_relationship_interfaces.py} (52%)
 create mode 100644 tests/extensions/aria_extension_tosca/simple_v1_0/types/node_type/test_node_type_requirements.py
 create mode 100644 tests/extensions/aria_extension_tosca/simple_v1_0/types/test_artifact_type.py
 create mode 100644 tests/extensions/aria_extension_tosca/simple_v1_0/types/test_capability_type.py
 create mode 100644 tests/extensions/aria_extension_tosca/simple_v1_0/types/test_data_type.py
 create mode 100644 tests/extensions/aria_extension_tosca/simple_v1_0/types/test_group_type.py
 create mode 100644 tests/extensions/aria_extension_tosca/simple_v1_0/types/test_interface_type.py
 create mode 100644 tests/extensions/aria_extension_tosca/simple_v1_0/types/test_policy_type.py
 create mode 100644 tests/extensions/aria_extension_tosca/simple_v1_0/types/test_relationship_type.py
 copy tests/{utils => mechanisms}/__init__.py (100%)
 create mode 100644 tests/mechanisms/parsing/__init__.py
 create mode 100644 tests/mechanisms/parsing/aria.py
 create mode 100644 tests/mechanisms/utils.py
 create mode 100644 tests/mechanisms/web_server.py
 delete mode 100644 tests/parser/test_tosca_simple_v1_0/presentation/__init__.py
 delete mode 100644 tests/parser/test_tosca_simple_v1_0/presentation/test_types.py
 delete mode 100644 tests/resources/service-templates/tosca-simple-1.0/types/shorthand-1/shorthand-1.yaml
 delete mode 100644 tests/resources/service-templates/tosca-simple-1.0/types/typequalified-1/typequalified-1.yaml
 copy tests/{utils => topology}/__init__.py (100%)
 rename tests/{parser => topology}/service_templates.py (80%)
 rename tests/{instantiation => topology}/test_configuration.py (98%)
 rename tests/{parser/test_tosca_simple_v1_0 => topology}/test_end2end.py (97%)
 rename tests/{parser => topology}/test_reqs_caps.py (100%)
 rename tests/{parser => topology}/utils.py (93%)

-- 
To stop receiving notification emails like this one, please contact
['"commits@ariatosca.apache.org" <co...@ariatosca.apache.org>'].

[incubator-ariatosca] 01/01: ARIA-414 Current events handler mechanism relies on sqlalchemy

Posted by mx...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

mxmrlv pushed a commit to branch ARIA-414-Current-events-handler-mechanism-relies-on-sqlalchemy
in repository https://gitbox.apache.org/repos/asf/incubator-ariatosca.git

commit 895c539ea13c752b667a2a461a5e94cada83a04f
Author: max-orlov <ma...@gigaspaces.com>
AuthorDate: Tue Nov 28 17:19:48 2017 +0200

    ARIA-414 Current events handler mechanism relies on sqlalchemy
---
 aria/orchestrator/context/operation.py             |   7 -
 aria/orchestrator/context/workflow.py              |   6 -
 aria/orchestrator/workflows/core/events_handler.py | 164 +++++++++++----------
 aria/orchestrator/workflows/executor/base.py       |   5 +-
 aria/orchestrator/workflows/executor/dry.py        |  51 +++----
 tests/orchestrator/workflows/executor/__init__.py  |  20 +--
 .../workflows/executor/test_executor.py            |  58 ++++----
 .../workflows/executor/test_process_executor.py    |  23 +--
 tests/orchestrator/workflows/helpers.py            |  18 +++
 9 files changed, 183 insertions(+), 169 deletions(-)

diff --git a/aria/orchestrator/context/operation.py b/aria/orchestrator/context/operation.py
index 7f6612e..449e282 100644
--- a/aria/orchestrator/context/operation.py
+++ b/aria/orchestrator/context/operation.py
@@ -18,7 +18,6 @@ Operation contexts.
 """
 
 import threading
-from contextlib import contextmanager
 
 import aria
 from aria.utils import file
@@ -106,12 +105,6 @@ class BaseOperationContext(common.BaseContext):
             self.model.log._session.remove()
             self.model.log._engine.dispose()
 
-    @property
-    @contextmanager
-    def persist_changes(self):
-        yield
-        self.model.task.update(self.task)
-
 
 class NodeOperationContext(BaseOperationContext):
     """
diff --git a/aria/orchestrator/context/workflow.py b/aria/orchestrator/context/workflow.py
index 5a323a6..c1868f8 100644
--- a/aria/orchestrator/context/workflow.py
+++ b/aria/orchestrator/context/workflow.py
@@ -93,12 +93,6 @@ class WorkflowContext(BaseContext):
             }
         )
 
-    @property
-    @contextmanager
-    def persist_changes(self):
-        yield
-        self._model.execution.update(self.execution)
-
 
 class _CurrentContext(threading.local):
     """
diff --git a/aria/orchestrator/workflows/core/events_handler.py b/aria/orchestrator/workflows/core/events_handler.py
index 067d0c3..7cec6f4 100644
--- a/aria/orchestrator/workflows/core/events_handler.py
+++ b/aria/orchestrator/workflows/core/events_handler.py
@@ -28,126 +28,130 @@ from ... import exceptions
 
 @events.sent_task_signal.connect
 def _task_sent(ctx, *args, **kwargs):
-    with ctx.persist_changes:
-        ctx.task.status = ctx.task.SENT
+    task = ctx.task
+    task.status = ctx.task.SENT
+    ctx.model.task.update(task)
 
 
 @events.start_task_signal.connect
 def _task_started(ctx, *args, **kwargs):
-    with ctx.persist_changes:
-        ctx.task.started_at = datetime.utcnow()
-        ctx.task.status = ctx.task.STARTED
-        _update_node_state_if_necessary(ctx, is_transitional=True)
+    task = ctx.task
+    ctx.task.started_at = datetime.utcnow()
+    ctx.task.status = ctx.task.STARTED
+    _update_node_state_if_necessary(ctx, is_transitional=True)
+    ctx.model.task.update(task)
 
 
 @events.on_failure_task_signal.connect
 def _task_failed(ctx, exception, *args, **kwargs):
-    with ctx.persist_changes:
-        should_retry = all([
-            not isinstance(exception, exceptions.TaskAbortException),
-            ctx.task.attempts_count < ctx.task.max_attempts or
-            ctx.task.max_attempts == ctx.task.INFINITE_RETRIES,
-            # ignore_failure check here means the task will not be retried and it will be marked
-            # as failed. The engine will also look at ignore_failure so it won't fail the
-            # workflow.
-            not ctx.task.ignore_failure
-        ])
-        if should_retry:
-            retry_interval = None
-            if isinstance(exception, exceptions.TaskRetryException):
-                retry_interval = exception.retry_interval
-            if retry_interval is None:
-                retry_interval = ctx.task.retry_interval
-            ctx.task.status = ctx.task.RETRYING
-            ctx.task.attempts_count += 1
-            ctx.task.due_at = datetime.utcnow() + timedelta(seconds=retry_interval)
-        else:
-            ctx.task.ended_at = datetime.utcnow()
-            ctx.task.status = ctx.task.FAILED
+    task = ctx.task
+    should_retry = all([
+        not isinstance(exception, exceptions.TaskAbortException),
+        task.attempts_count < task.max_attempts or
+        task.max_attempts == task.INFINITE_RETRIES,
+        # ignore_failure check here means the task will not be retried and it will be marked
+        # as failed. The engine will also look at ignore_failure so it won't fail the
+        # workflow.
+        not task.ignore_failure
+    ])
+    if should_retry:
+        retry_interval = None
+        if isinstance(exception, exceptions.TaskRetryException):
+            retry_interval = exception.retry_interval
+        if retry_interval is None:
+            retry_interval = ctx.task.retry_interval
+        task.status = task.RETRYING
+        task.attempts_count += 1
+        task.due_at = datetime.utcnow() + timedelta(seconds=retry_interval)
+    else:
+        task.ended_at = datetime.utcnow()
+        task.status = task.FAILED
+    ctx.model.task.update(task)
 
 
 @events.on_success_task_signal.connect
 def _task_succeeded(ctx, *args, **kwargs):
-    with ctx.persist_changes:
-        ctx.task.ended_at = datetime.utcnow()
-        ctx.task.status = ctx.task.SUCCESS
-        ctx.task.attempts_count += 1
+    task = ctx.task
+    ctx.task.ended_at = datetime.utcnow()
+    ctx.task.status = ctx.task.SUCCESS
+    ctx.task.attempts_count += 1
 
-        _update_node_state_if_necessary(ctx)
+    _update_node_state_if_necessary(ctx)
+    ctx.model.task.update(task)
 
 
 @events.start_workflow_signal.connect
 def _workflow_started(workflow_context, *args, **kwargs):
-    with workflow_context.persist_changes:
-        execution = workflow_context.execution
-        # the execution may already be in the process of cancelling
-        if execution.status in (execution.CANCELLING, execution.CANCELLED):
-            return
-        execution.status = execution.STARTED
-        execution.started_at = datetime.utcnow()
+    execution = workflow_context.execution
+    # the execution may already be in the process of cancelling
+    if execution.status in (execution.CANCELLING, execution.CANCELLED):
+        return
+    execution.status = execution.STARTED
+    execution.started_at = datetime.utcnow()
+    workflow_context.model.execution.update(execution)
 
 
 @events.on_failure_workflow_signal.connect
 def _workflow_failed(workflow_context, exception, *args, **kwargs):
-    with workflow_context.persist_changes:
-        execution = workflow_context.execution
-        execution.error = str(exception)
-        execution.status = execution.FAILED
-        execution.ended_at = datetime.utcnow()
+    execution = workflow_context.execution
+    execution.error = str(exception)
+    execution.status = execution.FAILED
+    execution.ended_at = datetime.utcnow()
+    workflow_context.model.execution.update(execution)
 
 
 @events.on_success_workflow_signal.connect
 def _workflow_succeeded(workflow_context, *args, **kwargs):
-    with workflow_context.persist_changes:
-        execution = workflow_context.execution
-        execution.status = execution.SUCCEEDED
-        execution.ended_at = datetime.utcnow()
+    execution = workflow_context.execution
+    execution.status = execution.SUCCEEDED
+    execution.ended_at = datetime.utcnow()
+    workflow_context.model.execution.update(execution)
 
 
 @events.on_cancelled_workflow_signal.connect
 def _workflow_cancelled(workflow_context, *args, **kwargs):
-    with workflow_context.persist_changes:
-        execution = workflow_context.execution
-        # _workflow_cancelling function may have called this function already
-        if execution.status == execution.CANCELLED:
-            return
-        # the execution may have already been finished
-        elif execution.status in (execution.SUCCEEDED, execution.FAILED):
-            _log_tried_to_cancel_execution_but_it_already_ended(workflow_context, execution.status)
-        else:
-            execution.status = execution.CANCELLED
-            execution.ended_at = datetime.utcnow()
+    execution = workflow_context.execution
+    # _workflow_cancelling function may have called this function already
+    if execution.status == execution.CANCELLED:
+        return
+    # the execution may have already been finished
+    elif execution.status in (execution.SUCCEEDED, execution.FAILED):
+        _log_tried_to_cancel_execution_but_it_already_ended(workflow_context, execution.status)
+    else:
+        execution.status = execution.CANCELLED
+        execution.ended_at = datetime.utcnow()
+    workflow_context.model.execution.update(execution)
 
 
 @events.on_resume_workflow_signal.connect
 def _workflow_resume(workflow_context, retry_failed=False, *args, **kwargs):
-    with workflow_context.persist_changes:
-        execution = workflow_context.execution
-        execution.status = execution.PENDING
-        # Any non ended task would be put back to pending state
+    execution = workflow_context.execution
+    execution.status = execution.PENDING
+    # Any non ended task would be put back to pending state
+    for task in execution.tasks:
+        if not task.has_ended():
+            task.status = task.PENDING
+
+    if retry_failed:
         for task in execution.tasks:
-            if not task.has_ended():
+            if task.status == task.FAILED and not task.ignore_failure:
+                task.attempts_count = 0
                 task.status = task.PENDING
-
-        if retry_failed:
-            for task in execution.tasks:
-                if task.status == task.FAILED and not task.ignore_failure:
-                    task.attempts_count = 0
-                    task.status = task.PENDING
+    workflow_context.model.execution.update(execution)
 
 
 
 @events.on_cancelling_workflow_signal.connect
 def _workflow_cancelling(workflow_context, *args, **kwargs):
-    with workflow_context.persist_changes:
-        execution = workflow_context.execution
-        if execution.status == execution.PENDING:
-            return _workflow_cancelled(workflow_context=workflow_context)
-        # the execution may have already been finished
-        elif execution.status in (execution.SUCCEEDED, execution.FAILED):
-            _log_tried_to_cancel_execution_but_it_already_ended(workflow_context, execution.status)
-        else:
-            execution.status = execution.CANCELLING
+    execution = workflow_context.execution
+    if execution.status == execution.PENDING:
+        return _workflow_cancelled(workflow_context=workflow_context)
+    # the execution may have already been finished
+    elif execution.status in (execution.SUCCEEDED, execution.FAILED):
+        _log_tried_to_cancel_execution_but_it_already_ended(workflow_context, execution.status)
+    else:
+        execution.status = execution.CANCELLING
+    workflow_context.model.execution.update(execution)
 
 
 def _update_node_state_if_necessary(ctx, is_transitional=False):
diff --git a/aria/orchestrator/workflows/executor/base.py b/aria/orchestrator/workflows/executor/base.py
index e7d03ea..d550b53 100644
--- a/aria/orchestrator/workflows/executor/base.py
+++ b/aria/orchestrator/workflows/executor/base.py
@@ -71,5 +71,6 @@ class BaseExecutor(logger.LoggerMixin):
 
 class StubTaskExecutor(BaseExecutor):                                                               # pylint: disable=abstract-method
     def execute(self, ctx, *args, **kwargs):
-        with ctx.persist_changes:
-            ctx.task.status = ctx.task.SUCCESS
+        task = ctx.task
+        task.status = ctx.task.SUCCESS
+        ctx.model.task.update(task)
diff --git a/aria/orchestrator/workflows/executor/dry.py b/aria/orchestrator/workflows/executor/dry.py
index bdb0eaf..797cd0d 100644
--- a/aria/orchestrator/workflows/executor/dry.py
+++ b/aria/orchestrator/workflows/executor/dry.py
@@ -27,28 +27,29 @@ class DryExecutor(base.BaseExecutor):
     Dry task executor: prints task information without causing any side effects.
     """
     def execute(self, ctx):
-        with ctx.persist_changes:
-            # updating the task manually instead of calling self._task_started(task),
-            # to avoid any side effects raising that event might cause
-            ctx.task.started_at = datetime.utcnow()
-            ctx.task.status = ctx.task.STARTED
-
-            dry_msg = u'<dry> {name} {task.interface_name}.{task.operation_name} {suffix}'
-            logger = ctx.logger.info if ctx.task.function else ctx.logger.debug
-
-            if hasattr(ctx.task.actor, 'source_node'):
-                name = u'{source_node.name}->{target_node.name}'.format(
-                    source_node=ctx.task.actor.source_node, target_node=ctx.task.actor.target_node)
-            else:
-                name = ctx.task.actor.name
-
-            if ctx.task.function:
-                logger(dry_msg.format(name=name, task=ctx.task, suffix='started...'))
-                logger(dry_msg.format(name=name, task=ctx.task, suffix='successful'))
-            else:
-                logger(dry_msg.format(name=name, task=ctx.task, suffix='has no implementation'))
-
-            # updating the task manually instead of calling self._task_succeeded(task),
-            # to avoid any side effects raising that event might cause
-            ctx.task.ended_at = datetime.utcnow()
-            ctx.task.status = ctx.task.SUCCESS
+        task = ctx.task
+        # updating the task manually instead of calling self._task_started(task),
+        # to avoid any side effects raising that event might cause
+        task.started_at = datetime.utcnow()
+        task.status = task.STARTED
+
+        dry_msg = '<dry> {name} {task.interface_name}.{task.operation_name} {suffix}'
+        logger = ctx.logger.info if task.function else ctx.logger.debug
+
+        if hasattr(task.actor, 'source_node'):
+            name = '{source_node.name}->{target_node.name}'.format(
+                source_node=task.actor.source_node, target_node=task.actor.target_node)
+        else:
+            name = task.actor.name
+
+        if task.function:
+            logger(dry_msg.format(name=name, task=ctx.task, suffix='started...'))
+            logger(dry_msg.format(name=name, task=ctx.task, suffix='successful'))
+        else:
+            logger(dry_msg.format(name=name, task=ctx.task, suffix='has no implementation'))
+
+        # updating the task manually instead of calling self._task_succeeded(task),
+        # to avoid any side effects raising that event might cause
+        task.ended_at = datetime.utcnow()
+        task.status = task.SUCCESS
+        ctx.model.task.update(task)
diff --git a/tests/orchestrator/workflows/executor/__init__.py b/tests/orchestrator/workflows/executor/__init__.py
index 99d0b39..5c25fa2 100644
--- a/tests/orchestrator/workflows/executor/__init__.py
+++ b/tests/orchestrator/workflows/executor/__init__.py
@@ -25,10 +25,12 @@ class MockContext(object):
 
     INSTRUMENTATION_FIELDS = BaseContext.INSTRUMENTATION_FIELDS
 
-    def __init__(self, storage, task_kwargs=None):
+    def __init__(self, storage=None, task_kwargs=None):
         self.logger = logging.getLogger('mock_logger')
         self._task_kwargs = task_kwargs or {}
-        self._storage = storage
+        import mock
+        self._storage = storage or mock.MagicMock()
+        self._storage_kwargs = self._storage.serialization_dict if storage else None
         self.task = MockTask(storage, **task_kwargs)
         self.states = []
         self.exception = None
@@ -38,7 +40,7 @@ class MockContext(object):
         return {
             'context_cls': self.__class__,
             'context': {
-                'storage_kwargs': self._storage.serialization_dict,
+                'storage_kwargs': self._storage_kwargs,
                 'task_kwargs': self._task_kwargs
             }
         }
@@ -55,13 +57,11 @@ class MockContext(object):
 
     @classmethod
     def instantiate_from_dict(cls, storage_kwargs=None, task_kwargs=None):
-        return cls(storage=aria.application_model_storage(**(storage_kwargs or {})),
-                   task_kwargs=(task_kwargs or {}))
-
-    @property
-    @contextmanager
-    def persist_changes(self):
-        yield
+        if storage_kwargs:
+            return cls(storage=aria.application_model_storage(**(storage_kwargs or {})),
+                       task_kwargs=task_kwargs)
+        else:
+            return cls(task_kwargs=task_kwargs)
 
 
 class MockActor(object):
diff --git a/tests/orchestrator/workflows/executor/test_executor.py b/tests/orchestrator/workflows/executor/test_executor.py
index 32a68e0..e537258 100644
--- a/tests/orchestrator/workflows/executor/test_executor.py
+++ b/tests/orchestrator/workflows/executor/test_executor.py
@@ -35,38 +35,40 @@ from aria.orchestrator.workflows.executor import (
 )
 
 import tests
+from .. import helpers
 from . import MockContext
 
 
+
 def _get_function(func):
     return '{module}.{func.__name__}'.format(module=__name__, func=func)
 
 
 def execute_and_assert(executor, storage=None):
     expected_value = 'value'
-    successful_task = MockContext(
+    successful_ctx = MockContext(
         storage, task_kwargs=dict(function=_get_function(mock_successful_task))
     )
-    failing_task = MockContext(
+    failing_ctx = MockContext(
         storage, task_kwargs=dict(function=_get_function(mock_failing_task))
     )
-    task_with_inputs = MockContext(
+    task_with_inputs_ctx = MockContext(
         storage,
         task_kwargs=dict(function=_get_function(mock_task_with_input),
                          arguments={'input': models.Argument.wrap('input', 'value')})
     )
 
-    for task in [successful_task, failing_task, task_with_inputs]:
-        executor.execute(task)
+    for ctx in [successful_ctx, failing_ctx, task_with_inputs_ctx]:
+        executor.execute(ctx)
 
     @retrying.retry(stop_max_delay=10000, wait_fixed=100)
     def assertion():
-        assert successful_task.states == ['start', 'success']
-        assert failing_task.states == ['start', 'failure']
-        assert task_with_inputs.states == ['start', 'failure']
-        assert isinstance(failing_task.exception, MockException)
-        assert isinstance(task_with_inputs.exception, MockException)
-        assert task_with_inputs.exception.message == expected_value
+        assert successful_ctx.states == ['start', 'success']
+        assert failing_ctx.states == ['start', 'failure']
+        assert task_with_inputs_ctx.states == ['start', 'failure']
+        assert isinstance(failing_ctx.exception, MockException)
+        assert isinstance(task_with_inputs_ctx.exception, MockException)
+        assert task_with_inputs_ctx.exception.message == expected_value
     assertion()
 
 
@@ -130,20 +132,20 @@ def process_executor():
 
 @pytest.fixture(autouse=True)
 def register_signals():
-    def start_handler(task, *args, **kwargs):
-        task.states.append('start')
-
-    def success_handler(task, *args, **kwargs):
-        task.states.append('success')
-
-    def failure_handler(task, exception, *args, **kwargs):
-        task.states.append('failure')
-        task.exception = exception
-
-    events.start_task_signal.connect(start_handler)
-    events.on_success_task_signal.connect(success_handler)
-    events.on_failure_task_signal.connect(failure_handler)
-    yield
-    events.start_task_signal.disconnect(start_handler)
-    events.on_success_task_signal.disconnect(success_handler)
-    events.on_failure_task_signal.disconnect(failure_handler)
+    def start_handler(ctx, *args, **kwargs):
+        ctx.states.append('start')
+
+    def success_handler(ctx, *args, **kwargs):
+        ctx.states.append('success')
+
+    def failure_handler(ctx, exception, *args, **kwargs):
+        ctx.states.append('failure')
+        ctx.exception = exception
+    with helpers.disconnect_event_handlers():
+        events.start_task_signal.connect(start_handler)
+        events.on_success_task_signal.connect(success_handler)
+        events.on_failure_task_signal.connect(failure_handler)
+        yield
+        events.start_task_signal.disconnect(start_handler)
+        events.on_success_task_signal.disconnect(success_handler)
+        events.on_failure_task_signal.disconnect(failure_handler)
diff --git a/tests/orchestrator/workflows/executor/test_process_executor.py b/tests/orchestrator/workflows/executor/test_process_executor.py
index d801ffb..94c3585 100644
--- a/tests/orchestrator/workflows/executor/test_process_executor.py
+++ b/tests/orchestrator/workflows/executor/test_process_executor.py
@@ -33,11 +33,12 @@ from aria.orchestrator.workflows.executor import process
 
 import tests.storage
 import tests.resources
-from tests.helpers import FilesystemDataHolder
-from tests.fixtures import (                                                                        # pylint: disable=unused-import
+from tests.fixtures import (  # pylint: disable=unused-import
     plugins_dir,
     plugin_manager,
 )
+from tests.helpers import FilesystemDataHolder
+from ..helpers import disconnect_event_handlers
 from . import MockContext
 
 
@@ -48,7 +49,6 @@ class TestProcessExecutor(object):
             model,
             task_kwargs=dict(function='mock_plugin1.operation', plugin_fk=mock_plugin.id)
         )
-
         executor.execute(ctx)
         error = queue.get(timeout=60)
         # tests/resources/plugins/mock-plugin1 is the plugin installed
@@ -85,7 +85,6 @@ while True:
         model.argument.put(holder_path_argument)
         model.argument.put(script_path_argument)
         ctx = MockContext(
-            model,
             task_kwargs=dict(
                 function='{0}.{1}'.format(__name__, freezing_task.__name__),
                 arguments=dict(holder_path=holder_path_argument,
@@ -124,13 +123,15 @@ def queue():
     def handler(_, exception=None, **kwargs):
         _queue.put(exception)
 
-    events.on_success_task_signal.connect(handler)
-    events.on_failure_task_signal.connect(handler)
-    try:
-        yield _queue
-    finally:
-        events.on_success_task_signal.disconnect(handler)
-        events.on_failure_task_signal.disconnect(handler)
+    with disconnect_event_handlers():
+
+        events.on_success_task_signal.connect(handler)
+        events.on_failure_task_signal.connect(handler)
+        try:
+            yield _queue
+        finally:
+            events.on_success_task_signal.disconnect(handler)
+            events.on_failure_task_signal.disconnect(handler)
 
 
 @pytest.fixture
diff --git a/tests/orchestrator/workflows/helpers.py b/tests/orchestrator/workflows/helpers.py
index 8e3f9b1..b1706d5 100644
--- a/tests/orchestrator/workflows/helpers.py
+++ b/tests/orchestrator/workflows/helpers.py
@@ -15,6 +15,9 @@
 
 from contextlib import contextmanager
 
+from aria.orchestrator import events
+from aria.orchestrator.workflows.core import events_handler
+
 
 @contextmanager
 def events_collector(*signals):
@@ -35,3 +38,18 @@ def events_collector(*signals):
     finally:
         for signal in signals:
             signal.disconnect(handlers[signal])
+
+
+@contextmanager
+def disconnect_event_handlers():
+    # disconnect the system events handler
+    events.start_task_signal.disconnect(events_handler._task_started)
+    events.on_success_task_signal.disconnect(events_handler._task_succeeded)
+    events.on_failure_task_signal.disconnect(events_handler._task_failed)
+    try:
+        yield
+    finally:
+        # reconnect the system events handler
+        events.start_task_signal.connect(events_handler._task_started)
+        events.on_success_task_signal.connect(events_handler._task_succeeded)
+        events.on_failure_task_signal.connect(events_handler._task_failed)

-- 
To stop receiving notification emails like this one, please contact
"commits@ariatosca.apache.org" <co...@ariatosca.apache.org>.