You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ariatosca.apache.org by mx...@apache.org on 2017/06/18 13:26:56 UTC

incubator-ariatosca git commit: added storage cleanup, retruned the pluginmanager-storage link

Repository: incubator-ariatosca
Updated Branches:
  refs/heads/ARIA-278-Remove-core-tasks 8bd8a2a4c -> 09c114bcc


added storage cleanup, retruned the pluginmanager-storage link


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

Branch: refs/heads/ARIA-278-Remove-core-tasks
Commit: 09c114bcc92ef21dc9b5759cbc310450a6d8d113
Parents: 8bd8a2a
Author: max-orlov <ma...@gigaspaces.com>
Authored: Sun Jun 18 16:26:51 2017 +0300
Committer: max-orlov <ma...@gigaspaces.com>
Committed: Sun Jun 18 16:26:51 2017 +0300

----------------------------------------------------------------------
 tests/__init__.py                                |  2 ++
 .../orchestrator/workflows/executor/__init__.py  |  1 -
 .../workflows/executor/test_executor.py          |  8 ++++----
 .../workflows/executor/test_process_executor.py  | 19 +++++++++----------
 tox.ini                                          |  4 ++--
 5 files changed, 17 insertions(+), 17 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/09c114bc/tests/__init__.py
----------------------------------------------------------------------
diff --git a/tests/__init__.py b/tests/__init__.py
index d2858d2..ace30c8 100644
--- a/tests/__init__.py
+++ b/tests/__init__.py
@@ -15,4 +15,6 @@
 
 import os
 
+from . import storage, mock
+
 ROOT_DIR = os.path.dirname(os.path.dirname(__file__))

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/09c114bc/tests/orchestrator/workflows/executor/__init__.py
----------------------------------------------------------------------
diff --git a/tests/orchestrator/workflows/executor/__init__.py b/tests/orchestrator/workflows/executor/__init__.py
index 42e81d4..97b24f3 100644
--- a/tests/orchestrator/workflows/executor/__init__.py
+++ b/tests/orchestrator/workflows/executor/__init__.py
@@ -18,7 +18,6 @@ from contextlib import contextmanager
 
 import aria
 from aria.modeling import models
-from aria.orchestrator.context.operation import NodeOperationContext
 
 
 class MockContext(object):

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/09c114bc/tests/orchestrator/workflows/executor/test_executor.py
----------------------------------------------------------------------
diff --git a/tests/orchestrator/workflows/executor/test_executor.py b/tests/orchestrator/workflows/executor/test_executor.py
index d9b1898..32a68e0 100644
--- a/tests/orchestrator/workflows/executor/test_executor.py
+++ b/tests/orchestrator/workflows/executor/test_executor.py
@@ -101,10 +101,10 @@ class MockException(Exception):
 
 @pytest.fixture
 def storage(tmpdir):
-    return aria.application_model_storage(
-        aria.storage.sql_mapi.SQLAlchemyModelAPI,
-        initiator_kwargs=dict(base_dir=str(tmpdir))
-    )
+    _storage = aria.application_model_storage(aria.storage.sql_mapi.SQLAlchemyModelAPI,
+                                              initiator_kwargs=dict(base_dir=str(tmpdir)))
+    yield _storage
+    tests.storage.release_sqlite_storage(_storage)
 
 
 @pytest.fixture(params=[

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/09c114bc/tests/orchestrator/workflows/executor/test_process_executor.py
----------------------------------------------------------------------
diff --git a/tests/orchestrator/workflows/executor/test_process_executor.py b/tests/orchestrator/workflows/executor/test_process_executor.py
index 57859ef..1da0601 100644
--- a/tests/orchestrator/workflows/executor/test_process_executor.py
+++ b/tests/orchestrator/workflows/executor/test_process_executor.py
@@ -28,16 +28,15 @@ import tests.resources
 from tests.fixtures import (  # pylint: disable=unused-import
     plugins_dir,
     plugin_manager,
-    fs_model as model
 )
 from . import MockTask, MockContext
 
 
 class TestProcessExecutor(object):
 
-    def test_plugin_execution(self, executor, mock_plugin, storage):
+    def test_plugin_execution(self, executor, mock_plugin, model):
         ctx = MockContext(
-            storage,
+            model,
             task_kwargs=dict(function='mock_plugin1.operation', plugin_fk=mock_plugin.id)
         )
 
@@ -66,10 +65,10 @@ class TestProcessExecutor(object):
             events.on_success_task_signal.disconnect(handler)
             events.on_failure_task_signal.disconnect(handler)
 
-    def test_closed(self, executor, storage):
+    def test_closed(self, executor, model):
         executor.close()
         with pytest.raises(RuntimeError) as exc_info:
-            executor.execute(MockContext(storage, task_kwargs=dict(function='some.function')))
+            executor.execute(MockContext(model, task_kwargs=dict(function='some.function')))
         assert 'closed' in exc_info.value.message
 
 
@@ -88,8 +87,8 @@ def mock_plugin(plugin_manager, tmpdir):
 
 
 @pytest.fixture
-def storage(tmpdir):
-    return aria.application_model_storage(
-        aria.storage.sql_mapi.SQLAlchemyModelAPI,
-        initiator_kwargs=dict(base_dir=str(tmpdir))
-    )
+def model(tmpdir):
+    _storage = aria.application_model_storage(aria.storage.sql_mapi.SQLAlchemyModelAPI,
+                                              initiator_kwargs=dict(base_dir=str(tmpdir)))
+    yield _storage
+    tests.storage.release_sqlite_storage(_storage)

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/09c114bc/tox.ini
----------------------------------------------------------------------
diff --git a/tox.ini b/tox.ini
index 5830e8a..d118c52 100644
--- a/tox.ini
+++ b/tox.ini
@@ -32,10 +32,10 @@ basepython =
   pylint_tests: python2.7
 
 [testenv:py27]
-commands=pytest tests --ignore=tests/end2end --ignore=/home/maxim-pcu/dev/repos/incubator-ariatosca/tests/orchestrator/workflows/executor --cov-report term-missing --cov aria
+commands=pytest tests --ignore=tests/end2end --cov-report term-missing --cov aria
 
 [testenv:py26]  
-commands=pytest tests --ignore=tests/end2end --ignore=/home/maxim-pcu/dev/repos/incubator-ariatosca/tests/orchestrator/workflows/executor --cov-report term-missing --cov aria
+commands=pytest tests --ignore=tests/end2end --cov-report term-missing --cov aria
 
 [testenv:py27e2e]
 commands=pytest tests/end2end --cov-report term-missing --cov aria