incubator-ariatosca git commit: test [Forced Update!]

2017-06-15 Thread ran
Repository: incubator-ariatosca
Updated Branches:
  refs/heads/test d91519c53 -> a61782c58 (forced update)


test


Project: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/repo
Commit: 
http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/commit/a61782c5
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/tree/a61782c5
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/diff/a61782c5

Branch: refs/heads/test
Commit: a61782c58b190096b74db9056634ec72f6d8027b
Parents: e6cf67e
Author: Ran Ziv 
Authored: Thu Jun 15 12:30:04 2017 +0300
Committer: Ran Ziv 
Committed: Thu Jun 15 13:14:54 2017 +0300

--
 tox.ini | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/a61782c5/tox.ini
--
diff --git a/tox.ini b/tox.ini
index 58e62c3..7e106cf 100644
--- a/tox.ini
+++ b/tox.ini
@@ -32,10 +32,10 @@ basepython =
   pylint_tests: python2.7
 
 [testenv:py27]
-commands=pytest tests --ignore=tests/end2end --cov-report term-missing --cov 
aria
+commands=pytest -vvv tests --ignore=tests/end2end
 
 [testenv:py26]
-commands=pytest tests --ignore=tests/end2end --cov-report term-missing --cov 
aria
+commands=pytest -vvv tests --ignore=tests/end2end
 
 [testenv:py27e2e]
 commands=pytest tests/end2end --cov-report term-missing --cov aria



incubator-ariatosca git commit: test

2017-06-15 Thread ran
Repository: incubator-ariatosca
Updated Branches:
  refs/heads/test e6cf67ec1 -> d91519c53


test


Project: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/repo
Commit: 
http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/commit/d91519c5
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/tree/d91519c5
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/diff/d91519c5

Branch: refs/heads/test
Commit: d91519c53a0237c5b104774071258e984ca1
Parents: e6cf67e
Author: Ran Ziv 
Authored: Thu Jun 15 12:30:04 2017 +0300
Committer: Ran Ziv 
Committed: Thu Jun 15 12:30:04 2017 +0300

--
 tox.ini | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/d91519c5/tox.ini
--
diff --git a/tox.ini b/tox.ini
index 58e62c3..7e106cf 100644
--- a/tox.ini
+++ b/tox.ini
@@ -32,10 +32,10 @@ basepython =
   pylint_tests: python2.7
 
 [testenv:py27]
-commands=pytest tests --ignore=tests/end2end --cov-report term-missing --cov 
aria
+commands=pytest -vvv tests --ignore=tests/end2end
 
 [testenv:py26]
-commands=pytest tests --ignore=tests/end2end --cov-report term-missing --cov 
aria
+commands=pytest -vvv tests --ignore=tests/end2end
 
 [testenv:py27e2e]
 commands=pytest tests/end2end --cov-report term-missing --cov aria



incubator-ariatosca git commit: test fixes, moved close executor to be handled inside the executor

2017-06-13 Thread mxmrlv
Repository: incubator-ariatosca
Updated Branches:
  refs/heads/ARIA-278-Remove-core-tasks 62fa985c6 -> 8044a035f


test fixes, moved close executor to be handled inside the executor


Project: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/repo
Commit: 
http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/commit/8044a035
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/tree/8044a035
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/diff/8044a035

Branch: refs/heads/ARIA-278-Remove-core-tasks
Commit: 8044a035fdb7f88e871e3a643b47b3e42c43da67
Parents: 62fa985
Author: max-orlov 
Authored: Tue Jun 13 15:56:44 2017 +0300
Committer: max-orlov 
Committed: Tue Jun 13 15:56:44 2017 +0300

--
 aria/modeling/orchestration.py  |  6 ++---
 aria/orchestrator/workflow_runner.py|  9 +--
 aria/orchestrator/workflows/core/engine.py  |  4 +--
 aria/orchestrator/workflows/core/translation.py |  5 +---
 aria/orchestrator/workflows/executor/base.py| 15 +++
 tests/modeling/test_mixins.py   |  8 --
 tests/orchestrator/context/test_operation.py| 28 +---
 tests/orchestrator/context/test_serialize.py| 14 ++
 tests/orchestrator/context/test_toolbelt.py |  7 +
 tests/orchestrator/test_workflow_runner.py  |  2 +-
 10 files changed, 41 insertions(+), 57 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/8044a035/aria/modeling/orchestration.py
--
diff --git a/aria/modeling/orchestration.py b/aria/modeling/orchestration.py
index 9ac885d..37aa431 100644
--- a/aria/modeling/orchestration.py
+++ b/aria/modeling/orchestration.py
@@ -461,7 +461,7 @@ class TaskBase(mixins.ModelMixin):
 
 return cls(**instantiation_kwargs)
 
-def execute(self, ctx):
+def execute(self, ctx, executor_kwargs=None):
 from aria.orchestrator.context import operation
 context_cls = self._context_cls or operation.BaseOperationContext
 op_ctx = context_cls(
@@ -474,10 +474,10 @@ class TaskBase(mixins.ModelMixin):
 execution_id=self.execution.id,
 name=self.name
 )
-executor = self._executor(**(self._executor_kwargs or {}))
+executor = self._executor(**dict(self._executor_kwargs or {}, 
**(executor_kwargs or {})))
 try:
 return executor.execute(op_ctx)
-finally:
+except BaseException:
 executor.close()
 
 

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/8044a035/aria/orchestrator/workflow_runner.py
--
diff --git a/aria/orchestrator/workflow_runner.py 
b/aria/orchestrator/workflow_runner.py
index 848c59b..961796a 100644
--- a/aria/orchestrator/workflow_runner.py
+++ b/aria/orchestrator/workflow_runner.py
@@ -39,7 +39,7 @@ class WorkflowRunner(object):
 
 def __init__(self, workflow_name, service_id, inputs,
  model_storage, resource_storage, plugin_manager,
- executor=None, task_max_attempts=DEFAULT_TASK_MAX_ATTEMPTS,
+ executor=None, executor_kwargs=None, 
task_max_attempts=DEFAULT_TASK_MAX_ATTEMPTS,
  task_retry_interval=DEFAULT_TASK_RETRY_INTERVAL):
 """
 Manages a single workflow execution on a given service.
@@ -84,9 +84,14 @@ class WorkflowRunner(object):
 execution_inputs_dict = dict(inp.unwrapped for inp in 
self.execution.inputs.values())
 self._tasks_graph = workflow_fn(ctx=workflow_context, 
**execution_inputs_dict)
 
-executor = executor or ProcessExecutor(plugin_manager=plugin_manager)
+# Set default executor and kwargs
+if executor is None:
+executor = ProcessExecutor
+executor_kwargs = dict(plugin_manager=plugin_manager)
+
 self._engine = Engine(
 executor=executor,
+executor_kwargs=executor_kwargs,
 workflow_context=workflow_context,
 tasks_graph=self._tasks_graph)
 

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/8044a035/aria/orchestrator/workflows/core/engine.py
--
diff --git a/aria/orchestrator/workflows/core/engine.py 
b/aria/orchestrator/workflows/core/engine.py
index 02749b7..826a7a2 100644
--- a/aria/orchestrator/workflows/core/engine.py
+++ b/aria/orchestrator/workflows/core/engine.py
@@ -41,10 +41,10 @@ class Engine(logger.LoggerMixin):
 super(Engine, self).__init__(**kwargs)
 self._workflow_context = workflow_context
 self._execution_graph = networkx.DiGraph()
+self._executor_kwargs = executor_kwargs
 translation.build_

incubator-ariatosca git commit: test

2017-06-12 Thread ran
Repository: incubator-ariatosca
Updated Branches:
  refs/heads/appveyor-colorama-test e38567a8b -> 75ed9071e


test


Project: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/repo
Commit: 
http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/commit/75ed9071
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/tree/75ed9071
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/diff/75ed9071

Branch: refs/heads/appveyor-colorama-test
Commit: 75ed9071e16f8b3bfbd24617709814b825306d2a
Parents: e38567a
Author: Ran Ziv 
Authored: Mon Jun 12 12:36:03 2017 +0300
Committer: Ran Ziv 
Committed: Mon Jun 12 12:36:03 2017 +0300

--
 appveyor.yml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/75ed9071/appveyor.yml
--
diff --git a/appveyor.yml b/appveyor.yml
index e40ca56..7dfea38 100644
--- a/appveyor.yml
+++ b/appveyor.yml
@@ -24,4 +24,4 @@ test_script:
   - pip --version
   - tox --version
   - pip list
-  - tox -e %TOX_ENV%
+  - tox -r -e %TOX_ENV%



incubator-ariatosca git commit: test

2017-06-12 Thread ran
Repository: incubator-ariatosca
Updated Branches:
  refs/heads/appveyor-colorama-test [created] e38567a8b


test


Project: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/repo
Commit: 
http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/commit/e38567a8
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/tree/e38567a8
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/diff/e38567a8

Branch: refs/heads/appveyor-colorama-test
Commit: e38567a8b53a05cca2b24c291ef58c1ab4bf172e
Parents: 5afa2f7
Author: Ran Ziv 
Authored: Mon Jun 12 12:33:09 2017 +0300
Committer: Ran Ziv 
Committed: Mon Jun 12 12:33:09 2017 +0300

--
 appveyor.yml | 1 +
 1 file changed, 1 insertion(+)
--


http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/e38567a8/appveyor.yml
--
diff --git a/appveyor.yml b/appveyor.yml
index cb1ae42..e40ca56 100644
--- a/appveyor.yml
+++ b/appveyor.yml
@@ -23,4 +23,5 @@ before_test:
 test_script:
   - pip --version
   - tox --version
+  - pip list
   - tox -e %TOX_ENV%



incubator-ariatosca git commit: test fixes [Forced Update!]

2017-06-11 Thread mxmrlv
Repository: incubator-ariatosca
Updated Branches:
  refs/heads/ARIA-276-Support-model-instrumentation-for-workflows 132bc55e0 -> 
ff1596e0d (forced update)


test fixes


Project: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/repo
Commit: 
http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/commit/ff1596e0
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/tree/ff1596e0
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/diff/ff1596e0

Branch: refs/heads/ARIA-276-Support-model-instrumentation-for-workflows
Commit: ff1596e0dd54fa284e9970028519da836becd624
Parents: 2b29c80
Author: max-orlov 
Authored: Sun Jun 11 11:46:04 2017 +0300
Committer: max-orlov 
Committed: Sun Jun 11 11:49:30 2017 +0300

--
 aria/orchestrator/workflows/api/task.py |  4 +-
 aria/orchestrator/workflows/core/task.py| 12 ++---
 aria/storage/collection_instrumentation.py  | 47 +++-
 .../orchestrator/execution_plugin/test_local.py | 26 ++-
 .../workflows/builtin/test_execute_operation.py |  9 ++--
 5 files changed, 53 insertions(+), 45 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/ff1596e0/aria/orchestrator/workflows/api/task.py
--
diff --git a/aria/orchestrator/workflows/api/task.py 
b/aria/orchestrator/workflows/api/task.py
index bcba56e..342448f 100644
--- a/aria/orchestrator/workflows/api/task.py
+++ b/aria/orchestrator/workflows/api/task.py
@@ -107,8 +107,8 @@ class OperationTask(BaseTask):
 :raises 
aria.orchestrator.workflows.exceptions.OperationNotFoundException: if
 ``interface_name`` and ``operation_name`` to not refer to an 
operation on the actor
 """
-
-assert isinstance(actor, (models.Node, models.Relationship))
+# If the actor is wrapped we retrieve the original class, o/w we 
compare the actor itself
+assert isinstance(getattr(actor, '_wrapped', actor), (models.Node, 
models.Relationship))
 
 # Creating OperationTask directly should raise an error when there is 
no
 # interface/operation.

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/ff1596e0/aria/orchestrator/workflows/core/task.py
--
diff --git a/aria/orchestrator/workflows/core/task.py 
b/aria/orchestrator/workflows/core/task.py
index 72d83ea..d732f09 100644
--- a/aria/orchestrator/workflows/core/task.py
+++ b/aria/orchestrator/workflows/core/task.py
@@ -124,20 +124,22 @@ class OperationTask(BaseTask):
 self.operation_name = api_task.operation_name
 model_storage = api_task._workflow_context.model
 
+actor = getattr(api_task.actor, '_wrapped', api_task.actor)
+
 base_task_model = model_storage.task.model_cls
-if isinstance(api_task.actor, models.Node):
+if isinstance(actor, models.Node):
 context_cls = operation_context.NodeOperationContext
 create_task_model = base_task_model.for_node
-elif isinstance(api_task.actor, models.Relationship):
+elif isinstance(actor, models.Relationship):
 context_cls = operation_context.RelationshipOperationContext
 create_task_model = base_task_model.for_relationship
 else:
 raise RuntimeError('No operation context could be created for 
{actor.model_cls}'
-   .format(actor=api_task.actor))
+   .format(actor=actor))
 
 task_model = create_task_model(
 name=api_task.name,
-actor=api_task.actor,
+actor=actor,
 status=base_task_model.PENDING,
 max_attempts=api_task.max_attempts,
 retry_interval=api_task.retry_interval,
@@ -156,7 +158,7 @@ class OperationTask(BaseTask):
 
resource_storage=self._workflow_context.resource,
 service_id=self._workflow_context._service_id,
 task_id=task_model.id,
-actor_id=api_task.actor.id,
+actor_id=actor.id,
 
execution_id=self._workflow_context._execution_id,
 workdir=self._workflow_context._workdir)
 self._task_id = task_model.id

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/ff1596e0/aria/storage/collection_instrumentation.py
--
diff --git a/aria/storage/collection_instrumentation.py 
b/aria/storage/collection_instrumentation.py
index 27d8322..b8f656c 100644
--- a/aria/storage/collection_instrumentation.py
+++ b/aria/storage/collection_instrumentation.py

incubator-ariatosca git commit: test fixes

2017-06-11 Thread mxmrlv
Repository: incubator-ariatosca
Updated Branches:
  refs/heads/ARIA-276-Support-model-instrumentation-for-workflows 2b29c80ff -> 
132bc55e0


test fixes


Project: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/repo
Commit: 
http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/commit/132bc55e
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/tree/132bc55e
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/diff/132bc55e

Branch: refs/heads/ARIA-276-Support-model-instrumentation-for-workflows
Commit: 132bc55e0de9427f0503bd3bfdc7b3358ca25858
Parents: 2b29c80
Author: max-orlov 
Authored: Sun Jun 11 11:46:04 2017 +0300
Committer: max-orlov 
Committed: Sun Jun 11 11:46:04 2017 +0300

--
 aria/orchestrator/workflows/api/task.py |  4 +-
 aria/orchestrator/workflows/core/task.py| 12 ++---
 aria/storage/collection_instrumentation.py  | 47 +++-
 .../orchestrator/execution_plugin/test_local.py | 25 ++-
 .../workflows/builtin/test_execute_operation.py |  9 ++--
 5 files changed, 52 insertions(+), 45 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/132bc55e/aria/orchestrator/workflows/api/task.py
--
diff --git a/aria/orchestrator/workflows/api/task.py 
b/aria/orchestrator/workflows/api/task.py
index bcba56e..342448f 100644
--- a/aria/orchestrator/workflows/api/task.py
+++ b/aria/orchestrator/workflows/api/task.py
@@ -107,8 +107,8 @@ class OperationTask(BaseTask):
 :raises 
aria.orchestrator.workflows.exceptions.OperationNotFoundException: if
 ``interface_name`` and ``operation_name`` to not refer to an 
operation on the actor
 """
-
-assert isinstance(actor, (models.Node, models.Relationship))
+# If the actor is wrapped we retrieve the original class, o/w we 
compare the actor itself
+assert isinstance(getattr(actor, '_wrapped', actor), (models.Node, 
models.Relationship))
 
 # Creating OperationTask directly should raise an error when there is 
no
 # interface/operation.

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/132bc55e/aria/orchestrator/workflows/core/task.py
--
diff --git a/aria/orchestrator/workflows/core/task.py 
b/aria/orchestrator/workflows/core/task.py
index 72d83ea..d732f09 100644
--- a/aria/orchestrator/workflows/core/task.py
+++ b/aria/orchestrator/workflows/core/task.py
@@ -124,20 +124,22 @@ class OperationTask(BaseTask):
 self.operation_name = api_task.operation_name
 model_storage = api_task._workflow_context.model
 
+actor = getattr(api_task.actor, '_wrapped', api_task.actor)
+
 base_task_model = model_storage.task.model_cls
-if isinstance(api_task.actor, models.Node):
+if isinstance(actor, models.Node):
 context_cls = operation_context.NodeOperationContext
 create_task_model = base_task_model.for_node
-elif isinstance(api_task.actor, models.Relationship):
+elif isinstance(actor, models.Relationship):
 context_cls = operation_context.RelationshipOperationContext
 create_task_model = base_task_model.for_relationship
 else:
 raise RuntimeError('No operation context could be created for 
{actor.model_cls}'
-   .format(actor=api_task.actor))
+   .format(actor=actor))
 
 task_model = create_task_model(
 name=api_task.name,
-actor=api_task.actor,
+actor=actor,
 status=base_task_model.PENDING,
 max_attempts=api_task.max_attempts,
 retry_interval=api_task.retry_interval,
@@ -156,7 +158,7 @@ class OperationTask(BaseTask):
 
resource_storage=self._workflow_context.resource,
 service_id=self._workflow_context._service_id,
 task_id=task_model.id,
-actor_id=api_task.actor.id,
+actor_id=actor.id,
 
execution_id=self._workflow_context._execution_id,
 workdir=self._workflow_context._workdir)
 self._task_id = task_model.id

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/132bc55e/aria/storage/collection_instrumentation.py
--
diff --git a/aria/storage/collection_instrumentation.py 
b/aria/storage/collection_instrumentation.py
index 27d8322..b8f656c 100644
--- a/aria/storage/collection_instrumentation.py
+++ b/aria/storage/collection_instrumentation.py
@@ -12,6 +12,7 @

incubator-ariatosca git commit: test 2

2017-06-07 Thread mxmrlv
Repository: incubator-ariatosca
Updated Branches:
  refs/heads/ARIA-213-Sporadic-tests-failures-over-locked-database-issue 
f3ecea1f4 -> 64690d2f6


test 2


Project: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/repo
Commit: 
http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/commit/64690d2f
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/tree/64690d2f
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/diff/64690d2f

Branch: refs/heads/ARIA-213-Sporadic-tests-failures-over-locked-database-issue
Commit: 64690d2f6ab515a2c15651d9a283b1159c14821a
Parents: f3ecea1
Author: max-orlov 
Authored: Wed Jun 7 12:17:40 2017 +0300
Committer: max-orlov 
Committed: Wed Jun 7 12:17:40 2017 +0300

--
 aria/storage/sql_mapi.py | 1 -
 1 file changed, 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/64690d2f/aria/storage/sql_mapi.py
--
diff --git a/aria/storage/sql_mapi.py b/aria/storage/sql_mapi.py
index 49876ee..657d769 100644
--- a/aria/storage/sql_mapi.py
+++ b/aria/storage/sql_mapi.py
@@ -419,7 +419,6 @@ def do_connect(dbapi_connection, _):
 dbapi_connection.isolation_level = None
 
 
-
 class ListResult(list):
 """
 a ListResult contains results about the requested items.



incubator-ariatosca git commit: test fixes [Forced Update!]

2017-05-17 Thread mxmrlv
Repository: incubator-ariatosca
Updated Branches:
  refs/heads/runtime_props_to_attr 577620341 -> 725b7f040 (forced update)


test fixes


Project: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/repo
Commit: 
http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/commit/725b7f04
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/tree/725b7f04
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/diff/725b7f04

Branch: refs/heads/runtime_props_to_attr
Commit: 725b7f040db1cbb6cca27f92cfcce3a6605ef223
Parents: d664259
Author: max-orlov 
Authored: Wed May 17 12:17:09 2017 +0300
Committer: max-orlov 
Committed: Wed May 17 12:29:26 2017 +0300

--
 aria/orchestrator/context/common.py |  3 +
 aria/orchestrator/workflows/executor/process.py |  3 +-
 tests/helpers.py|  3 +
 .../orchestrator/workflows/executor/__init__.py |  3 +
 ...process_executor_concurrent_modifications.py | 62 
 5 files changed, 36 insertions(+), 38 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/725b7f04/aria/orchestrator/context/common.py
--
diff --git a/aria/orchestrator/context/common.py 
b/aria/orchestrator/context/common.py
index 9758bb5..83f7215 100644
--- a/aria/orchestrator/context/common.py
+++ b/aria/orchestrator/context/common.py
@@ -197,6 +197,9 @@ class BaseContext(object):
 resource_template = jinja2.Template(resource_content)
 return resource_template.render(variables)
 
+def _teardown_db_resources(self):
+self.model.log._session.close()
+self.model.log._engine.dispose()
 
 class _Dict(collections.MutableMapping):
 def __init__(self, actor, model, nested=None):

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/725b7f04/aria/orchestrator/workflows/executor/process.py
--
diff --git a/aria/orchestrator/workflows/executor/process.py 
b/aria/orchestrator/workflows/executor/process.py
index d15d878..e83584b 100644
--- a/aria/orchestrator/workflows/executor/process.py
+++ b/aria/orchestrator/workflows/executor/process.py
@@ -309,8 +309,7 @@ def _main():
 task_func(ctx=ctx, **operation_inputs)
 messenger.succeeded()
 except BaseException as e:
-ctx.model.log._session.close()
-ctx.model.log._engine.dispose()
+ctx._teardown_db_resources()
 messenger.failed(e)
 
 if __name__ == '__main__':

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/725b7f04/tests/helpers.py
--
diff --git a/tests/helpers.py b/tests/helpers.py
index 133e33b..4c3194b 100644
--- a/tests/helpers.py
+++ b/tests/helpers.py
@@ -47,6 +47,9 @@ class FilesystemDataHolder(object):
 with open(self._path, 'w') as f:
 return json.dump(value, f)
 
+def __contains__(self, item):
+return item in self._load()
+
 def __setitem__(self, key, value):
 dict_ = self._load()
 dict_[key] = value

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/725b7f04/tests/orchestrator/workflows/executor/__init__.py
--
diff --git a/tests/orchestrator/workflows/executor/__init__.py 
b/tests/orchestrator/workflows/executor/__init__.py
index 8ad8edb..da2ed8b 100644
--- a/tests/orchestrator/workflows/executor/__init__.py
+++ b/tests/orchestrator/workflows/executor/__init__.py
@@ -74,3 +74,6 @@ class MockContext(object):
 return cls(storage=aria.application_model_storage(**kwargs))
 else:
 return cls()
+
+def _teardown_db_resources(cls):
+pass

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/725b7f04/tests/orchestrator/workflows/executor/test_process_executor_concurrent_modifications.py
--
diff --git 
a/tests/orchestrator/workflows/executor/test_process_executor_concurrent_modifications.py
 
b/tests/orchestrator/workflows/executor/test_process_executor_concurrent_modifications.py
index 8ed2f82..fe279ad 100644
--- 
a/tests/orchestrator/workflows/executor/test_process_executor_concurrent_modifications.py
+++ 
b/tests/orchestrator/workflows/executor/test_process_executor_concurrent_modifications.py
@@ -29,48 +29,37 @@ from tests.orchestrator.context import execute as 
execute_workflow
 from tests.orchestrator.workflows.helpers import events_collector
 from tests import mock
 from tests import storage
+from tests import helpers
 
 
-# TODO: rethink this entire module
-
-def test_concurrent_modification_on_task_succeeded(context, executor, 
lock_files):
-_test(conte

incubator-ariatosca git commit: test fixes

2017-05-17 Thread mxmrlv
Repository: incubator-ariatosca
Updated Branches:
  refs/heads/runtime_props_to_attr d66425941 -> 577620341


test fixes


Project: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/repo
Commit: 
http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/commit/57762034
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/tree/57762034
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/diff/57762034

Branch: refs/heads/runtime_props_to_attr
Commit: 577620341d5c7afc263b6df7682ef58cfc487f6e
Parents: d664259
Author: max-orlov 
Authored: Wed May 17 12:17:09 2017 +0300
Committer: max-orlov 
Committed: Wed May 17 12:17:09 2017 +0300

--
 aria/orchestrator/context/common.py |  3 +
 aria/orchestrator/workflows/executor/process.py |  3 +-
 tests/helpers.py|  3 +
 ...process_executor_concurrent_modifications.py | 62 
 4 files changed, 33 insertions(+), 38 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/57762034/aria/orchestrator/context/common.py
--
diff --git a/aria/orchestrator/context/common.py 
b/aria/orchestrator/context/common.py
index 9758bb5..83f7215 100644
--- a/aria/orchestrator/context/common.py
+++ b/aria/orchestrator/context/common.py
@@ -197,6 +197,9 @@ class BaseContext(object):
 resource_template = jinja2.Template(resource_content)
 return resource_template.render(variables)
 
+def _teardown_db_resources(self):
+self.model.log._session.close()
+self.model.log._engine.dispose()
 
 class _Dict(collections.MutableMapping):
 def __init__(self, actor, model, nested=None):

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/57762034/aria/orchestrator/workflows/executor/process.py
--
diff --git a/aria/orchestrator/workflows/executor/process.py 
b/aria/orchestrator/workflows/executor/process.py
index d15d878..e83584b 100644
--- a/aria/orchestrator/workflows/executor/process.py
+++ b/aria/orchestrator/workflows/executor/process.py
@@ -309,8 +309,7 @@ def _main():
 task_func(ctx=ctx, **operation_inputs)
 messenger.succeeded()
 except BaseException as e:
-ctx.model.log._session.close()
-ctx.model.log._engine.dispose()
+ctx._teardown_db_resources()
 messenger.failed(e)
 
 if __name__ == '__main__':

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/57762034/tests/helpers.py
--
diff --git a/tests/helpers.py b/tests/helpers.py
index 133e33b..4c3194b 100644
--- a/tests/helpers.py
+++ b/tests/helpers.py
@@ -47,6 +47,9 @@ class FilesystemDataHolder(object):
 with open(self._path, 'w') as f:
 return json.dump(value, f)
 
+def __contains__(self, item):
+return item in self._load()
+
 def __setitem__(self, key, value):
 dict_ = self._load()
 dict_[key] = value

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/57762034/tests/orchestrator/workflows/executor/test_process_executor_concurrent_modifications.py
--
diff --git 
a/tests/orchestrator/workflows/executor/test_process_executor_concurrent_modifications.py
 
b/tests/orchestrator/workflows/executor/test_process_executor_concurrent_modifications.py
index 8ed2f82..fe279ad 100644
--- 
a/tests/orchestrator/workflows/executor/test_process_executor_concurrent_modifications.py
+++ 
b/tests/orchestrator/workflows/executor/test_process_executor_concurrent_modifications.py
@@ -29,48 +29,37 @@ from tests.orchestrator.context import execute as 
execute_workflow
 from tests.orchestrator.workflows.helpers import events_collector
 from tests import mock
 from tests import storage
+from tests import helpers
 
 
-# TODO: rethink this entire module
-
-def test_concurrent_modification_on_task_succeeded(context, executor, 
lock_files):
-_test(context, executor, lock_files, _test_task_succeeded, 
expected_failure=True)
-
-
-@operation
-def _test_task_succeeded(ctx, lock_files, key, first_value, second_value):
-_concurrent_update(lock_files, ctx.node, key, first_value, second_value)
+@pytest.fixture
+def dataholder(tmpdir):
+dataholder_path = str(tmpdir.join('dataholder'))
+holder = helpers.FilesystemDataHolder(dataholder_path)
+return holder
 
 
-def test_concurrent_modification_on_task_failed(context, executor, lock_files):
-_test(context, executor, lock_files, _test_task_failed, 
expected_failure=True)
+def test_concurrent_modification_on_task_succeeded(context, executor, 
lock_files, dataholder):
+_test(context, executor, lock_files, _test_task_su

[12/12] incubator-ariatosca git commit: test fixes

2017-05-11 Thread mxmrlv
test fixes


Project: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/repo
Commit: 
http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/commit/ace30ae7
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/tree/ace30ae7
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/diff/ace30ae7

Branch: refs/heads/ARIA-213-Sporadic-tests-failures-over-locked-database-issue
Commit: ace30ae7347ea6f2519dd3a5f3c70fb441ec98f5
Parents: 3309709
Author: max-orlov 
Authored: Thu May 11 11:51:13 2017 +0300
Committer: max-orlov 
Committed: Thu May 11 14:28:49 2017 +0300

--
 aria/orchestrator/workflows/executor/process.py |  1 +
 aria/storage/instrumentation.py | 17 ++---
 .../orchestrator/workflows/executor/__init__.py | 21 ---
 .../workflows/executor/test_executor.py | 38 
 .../workflows/executor/test_process_executor.py | 13 +--
 tests/storage/test_instrumentation.py   |  2 +-
 6 files changed, 73 insertions(+), 19 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/ace30ae7/aria/orchestrator/workflows/executor/process.py
--
diff --git a/aria/orchestrator/workflows/executor/process.py 
b/aria/orchestrator/workflows/executor/process.py
index 04f0172..a2f92f9 100644
--- a/aria/orchestrator/workflows/executor/process.py
+++ b/aria/orchestrator/workflows/executor/process.py
@@ -375,6 +375,7 @@ def _main():
 ctx = 
context_dict['context_cls'].deserialize_from_dict(**context_dict['context'])
 except BaseException as e:
 messenger.failed(exception=e, tracked_changes=None, new_instances=None)
+return
 
 with instrumentation.track_changes(ctx) as instrument:
 try:

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/ace30ae7/aria/storage/instrumentation.py
--
diff --git a/aria/storage/instrumentation.py b/aria/storage/instrumentation.py
index b0738c8..98770de 100644
--- a/aria/storage/instrumentation.py
+++ b/aria/storage/instrumentation.py
@@ -27,7 +27,7 @@ _INSTRUMENTED = {
 'modified': {
 _models.Node.runtime_properties: dict,
 _models.Node.state: str,
-# _models.Task.status: str,
+_models.Task.status: str,
 },
 'new': (_models.Log, )
 
@@ -36,7 +36,7 @@ _INSTRUMENTED = {
 _NEW_INSTANCE = 'NEW_INSTANCE'
 
 
-def track_changes(ctx, instrumented=None):
+def track_changes(ctx=None, instrumented=None):
 """Track changes in the specified model columns
 
 This call will register event listeners using sqlalchemy's event 
mechanism. The listeners
@@ -96,6 +96,12 @@ class _Instrumentation(object):
 self._register_instance_listener(ctx, instrumented_class)
 
 def _register_instance_listener(self, ctx, instrumented_class):
+if ctx is None:
+if instrumented_class:
+raise StorageError("In order to keep track of new instances, a 
ctx is needed")
+else:
+return
+
 def listener(session, instance):
 if not isinstance(instance, instrumented_class):
 return
@@ -105,8 +111,11 @@ class _Instrumentation(object):
 instance_as_dict = instance.to_dict()
 instance_as_dict.update((k, getattr(instance, k)) for k in 
instance.__private_fields__)
 tracked_attributes.update(instance_as_dict)
-session = getattr(ctx.model, instrumented_class.__tablename__)._session
-listener_args = (session, 'after_attach', listener)
+mapi = getattr(ctx.model, instrumented_class.__tablename__, None)
+if not mapi:
+raise StorageError(
+"Could not retrieve session for 
{0}".format(instrumented_class.__tablename__))
+listener_args = (mapi._session, 'after_attach', listener)
 sqlalchemy.event.listen(*listener_args)
 self.listeners.append(listener_args)
 

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/ace30ae7/tests/orchestrator/workflows/executor/__init__.py
--
diff --git a/tests/orchestrator/workflows/executor/__init__.py 
b/tests/orchestrator/workflows/executor/__init__.py
index cedcc5f..8ad8edb 100644
--- a/tests/orchestrator/workflows/executor/__init__.py
+++ b/tests/orchestrator/workflows/executor/__init__.py
@@ -17,6 +17,7 @@ import logging
 from collections import namedtuple
 from contextlib import contextmanager
 
+import aria
 from aria.modeling import models
 
 
@@ -24,7 +25,7 @@ class MockTask(object):
 
 INFINITE_RETRIES = models.Task.INFINITE_RETRIES
 
-def __init__(self, implementation, inputs=None, plugin=None):
+def __init__(self, im

incubator-ariatosca git commit: test fixes [Forced Update!]

2017-05-11 Thread mxmrlv
Repository: incubator-ariatosca
Updated Branches:
  refs/heads/ARIA-213-Sporadic-tests-failures-over-locked-database-issue 
c213f93ad -> a5fc80931 (forced update)


test fixes


Project: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/repo
Commit: 
http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/commit/a5fc8093
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/tree/a5fc8093
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/diff/a5fc8093

Branch: refs/heads/ARIA-213-Sporadic-tests-failures-over-locked-database-issue
Commit: a5fc809319bb56864be04aa001068822764eb55c
Parents: 663848f
Author: max-orlov 
Authored: Thu May 11 11:51:13 2017 +0300
Committer: max-orlov 
Committed: Thu May 11 11:58:47 2017 +0300

--
 aria/orchestrator/workflows/executor/process.py |  1 +
 aria/storage/instrumentation.py | 17 ++---
 .../orchestrator/workflows/executor/__init__.py | 21 ---
 .../workflows/executor/test_executor.py | 38 
 .../workflows/executor/test_process_executor.py | 13 +--
 tests/storage/test_instrumentation.py   |  2 +-
 6 files changed, 73 insertions(+), 19 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/a5fc8093/aria/orchestrator/workflows/executor/process.py
--
diff --git a/aria/orchestrator/workflows/executor/process.py 
b/aria/orchestrator/workflows/executor/process.py
index 04f0172..a2f92f9 100644
--- a/aria/orchestrator/workflows/executor/process.py
+++ b/aria/orchestrator/workflows/executor/process.py
@@ -375,6 +375,7 @@ def _main():
 ctx = 
context_dict['context_cls'].deserialize_from_dict(**context_dict['context'])
 except BaseException as e:
 messenger.failed(exception=e, tracked_changes=None, new_instances=None)
+return
 
 with instrumentation.track_changes(ctx) as instrument:
 try:

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/a5fc8093/aria/storage/instrumentation.py
--
diff --git a/aria/storage/instrumentation.py b/aria/storage/instrumentation.py
index b0738c8..98770de 100644
--- a/aria/storage/instrumentation.py
+++ b/aria/storage/instrumentation.py
@@ -27,7 +27,7 @@ _INSTRUMENTED = {
 'modified': {
 _models.Node.runtime_properties: dict,
 _models.Node.state: str,
-# _models.Task.status: str,
+_models.Task.status: str,
 },
 'new': (_models.Log, )
 
@@ -36,7 +36,7 @@ _INSTRUMENTED = {
 _NEW_INSTANCE = 'NEW_INSTANCE'
 
 
-def track_changes(ctx, instrumented=None):
+def track_changes(ctx=None, instrumented=None):
 """Track changes in the specified model columns
 
 This call will register event listeners using sqlalchemy's event 
mechanism. The listeners
@@ -96,6 +96,12 @@ class _Instrumentation(object):
 self._register_instance_listener(ctx, instrumented_class)
 
 def _register_instance_listener(self, ctx, instrumented_class):
+if ctx is None:
+if instrumented_class:
+raise StorageError("In order to keep track of new instances, a 
ctx is needed")
+else:
+return
+
 def listener(session, instance):
 if not isinstance(instance, instrumented_class):
 return
@@ -105,8 +111,11 @@ class _Instrumentation(object):
 instance_as_dict = instance.to_dict()
 instance_as_dict.update((k, getattr(instance, k)) for k in 
instance.__private_fields__)
 tracked_attributes.update(instance_as_dict)
-session = getattr(ctx.model, instrumented_class.__tablename__)._session
-listener_args = (session, 'after_attach', listener)
+mapi = getattr(ctx.model, instrumented_class.__tablename__, None)
+if not mapi:
+raise StorageError(
+"Could not retrieve session for 
{0}".format(instrumented_class.__tablename__))
+listener_args = (mapi._session, 'after_attach', listener)
 sqlalchemy.event.listen(*listener_args)
 self.listeners.append(listener_args)
 

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/a5fc8093/tests/orchestrator/workflows/executor/__init__.py
--
diff --git a/tests/orchestrator/workflows/executor/__init__.py 
b/tests/orchestrator/workflows/executor/__init__.py
index cedcc5f..8ad8edb 100644
--- a/tests/orchestrator/workflows/executor/__init__.py
+++ b/tests/orchestrator/workflows/executor/__init__.py
@@ -17,6 +17,7 @@ import logging
 from collections import namedtuple
 from contextlib import contextmanager
 
+import aria
 from aria.modeling import models
 
 
@@ -24,7 +25,7 @@ class Moc

incubator-ariatosca git commit: test fixes

2017-05-11 Thread mxmrlv
Repository: incubator-ariatosca
Updated Branches:
  refs/heads/ARIA-213-Sporadic-tests-failures-over-locked-database-issue 
663848f89 -> c213f93ad


test fixes


Project: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/repo
Commit: 
http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/commit/c213f93a
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/tree/c213f93a
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/diff/c213f93a

Branch: refs/heads/ARIA-213-Sporadic-tests-failures-over-locked-database-issue
Commit: c213f93adecb01238b2083d9a1f9f74fce854861
Parents: 663848f
Author: max-orlov 
Authored: Thu May 11 11:51:13 2017 +0300
Committer: max-orlov 
Committed: Thu May 11 11:51:13 2017 +0300

--
 aria/orchestrator/workflows/executor/process.py |  1 +
 aria/storage/instrumentation.py | 17 ++---
 .../orchestrator/workflows/executor/__init__.py | 22 +---
 .../workflows/executor/test_executor.py | 38 
 .../workflows/executor/test_process_executor.py | 13 +--
 tests/storage/test_instrumentation.py   |  2 +-
 6 files changed, 74 insertions(+), 19 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/c213f93a/aria/orchestrator/workflows/executor/process.py
--
diff --git a/aria/orchestrator/workflows/executor/process.py 
b/aria/orchestrator/workflows/executor/process.py
index 04f0172..a2f92f9 100644
--- a/aria/orchestrator/workflows/executor/process.py
+++ b/aria/orchestrator/workflows/executor/process.py
@@ -375,6 +375,7 @@ def _main():
 ctx = 
context_dict['context_cls'].deserialize_from_dict(**context_dict['context'])
 except BaseException as e:
 messenger.failed(exception=e, tracked_changes=None, new_instances=None)
+return
 
 with instrumentation.track_changes(ctx) as instrument:
 try:

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/c213f93a/aria/storage/instrumentation.py
--
diff --git a/aria/storage/instrumentation.py b/aria/storage/instrumentation.py
index b0738c8..98770de 100644
--- a/aria/storage/instrumentation.py
+++ b/aria/storage/instrumentation.py
@@ -27,7 +27,7 @@ _INSTRUMENTED = {
 'modified': {
 _models.Node.runtime_properties: dict,
 _models.Node.state: str,
-# _models.Task.status: str,
+_models.Task.status: str,
 },
 'new': (_models.Log, )
 
@@ -36,7 +36,7 @@ _INSTRUMENTED = {
 _NEW_INSTANCE = 'NEW_INSTANCE'
 
 
-def track_changes(ctx, instrumented=None):
+def track_changes(ctx=None, instrumented=None):
 """Track changes in the specified model columns
 
 This call will register event listeners using sqlalchemy's event 
mechanism. The listeners
@@ -96,6 +96,12 @@ class _Instrumentation(object):
 self._register_instance_listener(ctx, instrumented_class)
 
 def _register_instance_listener(self, ctx, instrumented_class):
+if ctx is None:
+if instrumented_class:
+raise StorageError("In order to keep track of new instances, a 
ctx is needed")
+else:
+return
+
 def listener(session, instance):
 if not isinstance(instance, instrumented_class):
 return
@@ -105,8 +111,11 @@ class _Instrumentation(object):
 instance_as_dict = instance.to_dict()
 instance_as_dict.update((k, getattr(instance, k)) for k in 
instance.__private_fields__)
 tracked_attributes.update(instance_as_dict)
-session = getattr(ctx.model, instrumented_class.__tablename__)._session
-listener_args = (session, 'after_attach', listener)
+mapi = getattr(ctx.model, instrumented_class.__tablename__, None)
+if not mapi:
+raise StorageError(
+"Could not retrieve session for 
{0}".format(instrumented_class.__tablename__))
+listener_args = (mapi._session, 'after_attach', listener)
 sqlalchemy.event.listen(*listener_args)
 self.listeners.append(listener_args)
 

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/c213f93a/tests/orchestrator/workflows/executor/__init__.py
--
diff --git a/tests/orchestrator/workflows/executor/__init__.py 
b/tests/orchestrator/workflows/executor/__init__.py
index cedcc5f..09d1a9e 100644
--- a/tests/orchestrator/workflows/executor/__init__.py
+++ b/tests/orchestrator/workflows/executor/__init__.py
@@ -17,6 +17,7 @@ import logging
 from collections import namedtuple
 from contextlib import contextmanager
 
+import aria
 from aria.modeling import models
 
 
@@ -24,7 +25,7 @@ class MockTask(object):

incubator-ariatosca git commit: test

2016-10-18 Thread dankilman
Repository: incubator-ariatosca
Updated Branches:
  refs/heads/wf-executor 73f327df7 -> 9661d2dbb


test


Project: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/repo
Commit: 
http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/commit/9661d2db
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/tree/9661d2db
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/diff/9661d2db

Branch: refs/heads/wf-executor
Commit: 9661d2dbb96d3ec5d02259201cfa718fb83cec11
Parents: 73f327d
Author: Dan Kilman 
Authored: Tue Oct 18 23:46:31 2016 +0300
Committer: Dan Kilman 
Committed: Tue Oct 18 23:46:31 2016 +0300

--
 tox.ini | 1 +
 1 file changed, 1 insertion(+)
--


http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/9661d2db/tox.ini
--
diff --git a/tox.ini b/tox.ini
index bc7fb8f..fdeb4b1 100644
--- a/tox.ini
+++ b/tox.ini
@@ -11,5 +11,6 @@ commands=py.test tests --cov-report term-missing --cov aria
 [testenv:pylint_package]
 commands=pylint aria --rcfile=.pylintrc --disable=cyclic-import,fixme
 
+
 [testenv:pylint_tests]
 commands=pylint tests --rcfile=.pylintrc 
--disable=invalid-name,too-many-statements,too-few-public-methods,too-many-lines,too-many-public-methods,unused-argument,line-too-long,no-member,too-many-locals,duplicate-code,too-many-branches,too-many-arguments,fixme