incubator-ariatosca git commit: ARIA-14 Implement initial engine tests [Forced Update!]

2016-11-03 Thread dankilman
Repository: incubator-ariatosca
Updated Branches:
  refs/heads/ARIA-14-workflow-engine-tests f87d50aa2 -> 3fc8ee4f3 (forced 
update)


ARIA-14 Implement initial engine tests


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

Branch: refs/heads/ARIA-14-workflow-engine-tests
Commit: 3fc8ee4f36fef3954bcc1e89c4d97572061b41c5
Parents: c0bf347
Author: Dan Kilman 
Authored: Tue Nov 1 16:42:34 2016 +0200
Committer: Dan Kilman 
Committed: Thu Nov 3 12:02:29 2016 +0200

--
 aria/contexts.py |   4 +-
 aria/events/__init__.py  |   1 +
 aria/events/builtin_event_handler.py |  15 ++-
 aria/storage/models.py   |   6 +-
 aria/tools/application.py|  10 +-
 aria/workflows/core/engine.py|  26 +++--
 aria/workflows/core/tasks.py |  33 --
 tests/.pylintrc  |   2 +-
 tests/workflows/test_engine.py   | 182 ++
 9 files changed, 249 insertions(+), 30 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/3fc8ee4f/aria/contexts.py
--
diff --git a/aria/contexts.py b/aria/contexts.py
index ae7fc66..fdd26a2 100644
--- a/aria/contexts.py
+++ b/aria/contexts.py
@@ -201,11 +201,11 @@ class OperationContext(LoggerMixin):
 """
 The model operation
 """
-return self.storage.operation.get(self.id)
+return self.model.operation.get(self.id)
 
 @operation.setter
 def operation(self, value):
 """
 Store the operation in the model storage
 """
-self.storage.operation.store(value)
+self.model.operation.store(value)

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/3fc8ee4f/aria/events/__init__.py
--
diff --git a/aria/events/__init__.py b/aria/events/__init__.py
index 6b07213..74f3e22 100644
--- a/aria/events/__init__.py
+++ b/aria/events/__init__.py
@@ -39,6 +39,7 @@ from blinker import signal
 from ..tools.plugin import plugin_installer
 
 # workflow engine task signals:
+sent_task_signal = signal('sent_task_signal')
 start_task_signal = signal('start_task_signal')
 on_success_task_signal = signal('success_task_signal')
 on_failure_task_signal = signal('failure_task_signal')

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/3fc8ee4f/aria/events/builtin_event_handler.py
--
diff --git a/aria/events/builtin_event_handler.py 
b/aria/events/builtin_event_handler.py
index ec3238f..2dfbd00 100644
--- a/aria/events/builtin_event_handler.py
+++ b/aria/events/builtin_event_handler.py
@@ -27,12 +27,21 @@ from . import (
 start_workflow_signal,
 on_success_workflow_signal,
 on_failure_workflow_signal,
+sent_task_signal,
 start_task_signal,
 on_success_task_signal,
 on_failure_task_signal,
 )
 
 
+@sent_task_signal.connect
+def _task_sent(task, *args, **kwargs):
+operation_context = task.context
+operation = operation_context.operation
+operation.status = operation.SENT
+operation_context.operation = operation
+
+
 @start_task_signal.connect
 def _task_started(task, *args, **kwargs):
 operation_context = task.context
@@ -62,7 +71,7 @@ def _task_succeeded(task, *args, **kwargs):
 
 @start_workflow_signal.connect
 def _workflow_started(workflow_context, *args, **kwargs):
-execution_cls = workflow_context.storage.execution.model_cls
+execution_cls = workflow_context.model.execution.model_cls
 execution = execution_cls(
 id=workflow_context.execution_id,
 deployment_id=workflow_context.deployment_id,
@@ -80,7 +89,7 @@ def _workflow_failed(workflow_context, exception, *args, 
**kwargs):
 execution = workflow_context.execution
 execution.error = str(exception)
 execution.status = execution.FAILED
-execution.ended_at = datetime.utcnow(),
+execution.ended_at = datetime.utcnow()
 workflow_context.execution = execution
 
 
@@ -88,5 +97,5 @@ def _workflow_failed(workflow_context, exception, *args, 
**kwargs):
 def _workflow_succeeded(workflow_context, *args, **kwargs):
 execution = workflow_context.execution
 execution.status = execution.TERMINATED
-execution.ended_at = datetime.utcnow(),
+execution.ended_at = datetime.utcnow()
 workflow_context.execution = execution


incubator-ariatosca git commit: ARIA-14 Implement initial engine tests [Forced Update!]

2016-11-02 Thread dankilman
Repository: incubator-ariatosca
Updated Branches:
  refs/heads/ARIA-14-workflow-engine-tests d08040bd6 -> f87d50aa2 (forced 
update)


ARIA-14 Implement initial engine tests


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

Branch: refs/heads/ARIA-14-workflow-engine-tests
Commit: f87d50aa2b2885782ce51a283609eb7342f9935a
Parents: c0bf347
Author: Dan Kilman 
Authored: Tue Nov 1 16:42:34 2016 +0200
Committer: Dan Kilman 
Committed: Thu Nov 3 00:25:27 2016 +0200

--
 aria/contexts.py |   4 +-
 aria/events/__init__.py  |   1 +
 aria/events/builtin_event_handler.py |  15 ++-
 aria/storage/models.py   |   6 +-
 aria/tools/application.py|  10 +-
 aria/workflows/core/engine.py|  23 ++--
 aria/workflows/core/tasks.py |  33 +++--
 tests/.pylintrc  |   2 +-
 tests/workflows/test_engine.py   | 203 ++
 9 files changed, 268 insertions(+), 29 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/f87d50aa/aria/contexts.py
--
diff --git a/aria/contexts.py b/aria/contexts.py
index ae7fc66..fdd26a2 100644
--- a/aria/contexts.py
+++ b/aria/contexts.py
@@ -201,11 +201,11 @@ class OperationContext(LoggerMixin):
 """
 The model operation
 """
-return self.storage.operation.get(self.id)
+return self.model.operation.get(self.id)
 
 @operation.setter
 def operation(self, value):
 """
 Store the operation in the model storage
 """
-self.storage.operation.store(value)
+self.model.operation.store(value)

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/f87d50aa/aria/events/__init__.py
--
diff --git a/aria/events/__init__.py b/aria/events/__init__.py
index 6b07213..74f3e22 100644
--- a/aria/events/__init__.py
+++ b/aria/events/__init__.py
@@ -39,6 +39,7 @@ from blinker import signal
 from ..tools.plugin import plugin_installer
 
 # workflow engine task signals:
+sent_task_signal = signal('sent_task_signal')
 start_task_signal = signal('start_task_signal')
 on_success_task_signal = signal('success_task_signal')
 on_failure_task_signal = signal('failure_task_signal')

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/f87d50aa/aria/events/builtin_event_handler.py
--
diff --git a/aria/events/builtin_event_handler.py 
b/aria/events/builtin_event_handler.py
index ec3238f..2dfbd00 100644
--- a/aria/events/builtin_event_handler.py
+++ b/aria/events/builtin_event_handler.py
@@ -27,12 +27,21 @@ from . import (
 start_workflow_signal,
 on_success_workflow_signal,
 on_failure_workflow_signal,
+sent_task_signal,
 start_task_signal,
 on_success_task_signal,
 on_failure_task_signal,
 )
 
 
+@sent_task_signal.connect
+def _task_sent(task, *args, **kwargs):
+operation_context = task.context
+operation = operation_context.operation
+operation.status = operation.SENT
+operation_context.operation = operation
+
+
 @start_task_signal.connect
 def _task_started(task, *args, **kwargs):
 operation_context = task.context
@@ -62,7 +71,7 @@ def _task_succeeded(task, *args, **kwargs):
 
 @start_workflow_signal.connect
 def _workflow_started(workflow_context, *args, **kwargs):
-execution_cls = workflow_context.storage.execution.model_cls
+execution_cls = workflow_context.model.execution.model_cls
 execution = execution_cls(
 id=workflow_context.execution_id,
 deployment_id=workflow_context.deployment_id,
@@ -80,7 +89,7 @@ def _workflow_failed(workflow_context, exception, *args, 
**kwargs):
 execution = workflow_context.execution
 execution.error = str(exception)
 execution.status = execution.FAILED
-execution.ended_at = datetime.utcnow(),
+execution.ended_at = datetime.utcnow()
 workflow_context.execution = execution
 
 
@@ -88,5 +97,5 @@ def _workflow_failed(workflow_context, exception, *args, 
**kwargs):
 def _workflow_succeeded(workflow_context, *args, **kwargs):
 execution = workflow_context.execution
 execution.status = execution.TERMINATED
-execution.ended_at = datetime.utcnow(),
+execution.ended_at = datetime.utcnow()
 workflow_context.execution = execution