You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ariatosca.apache.org by em...@apache.org on 2017/02/07 14:39:42 UTC
incubator-ariatosca git commit: Changes for 1st code review
Repository: incubator-ariatosca
Updated Branches:
refs/heads/ARIA-99-e2e-tests f94bff047 -> 88d6aa227
Changes for 1st code review
Project: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/commit/88d6aa22
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/tree/88d6aa22
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/diff/88d6aa22
Branch: refs/heads/ARIA-99-e2e-tests
Commit: 88d6aa22749322a61b3b1cc71cbb6f0d732c68c2
Parents: f94bff0
Author: Tal Liron <ta...@gmail.com>
Authored: Tue Feb 7 08:39:21 2017 -0600
Committer: Tal Liron <ta...@gmail.com>
Committed: Tue Feb 7 08:39:21 2017 -0600
----------------------------------------------------------------------
tests/complete/test_complete.py | 40 +++++++++++++
tests/complete/test_parser.py | 60 ++++++++++++++++++++
tests/orchestrator/test_complete.py | 58 -------------------
tests/parser/test_complete.py | 40 -------------
.../node-cellar/node-cellar.yaml | 6 +-
5 files changed, 103 insertions(+), 101 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/88d6aa22/tests/complete/test_complete.py
----------------------------------------------------------------------
diff --git a/tests/complete/test_complete.py b/tests/complete/test_complete.py
new file mode 100644
index 0000000..7c243ab
--- /dev/null
+++ b/tests/complete/test_complete.py
@@ -0,0 +1,40 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+from tests.parser.service_templates import consume_node_cellar
+
+
+def test_validation():
+ consume_node_cellar('validate')
+
+
+def test_validation_no_cache():
+ consume_node_cellar('validate', False)
+
+
+def test_presentation():
+ consume_node_cellar('presentation')
+
+
+def test_model():
+ consume_node_cellar('model')
+
+
+def test_types():
+ consume_node_cellar('types')
+
+
+def test_instance():
+ consume_node_cellar('instance')
http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/88d6aa22/tests/complete/test_parser.py
----------------------------------------------------------------------
diff --git a/tests/complete/test_parser.py b/tests/complete/test_parser.py
new file mode 100644
index 0000000..f930577
--- /dev/null
+++ b/tests/complete/test_parser.py
@@ -0,0 +1,60 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+import sys
+
+from aria.orchestrator.runner import Runner
+from aria.orchestrator.workflows.builtin import BUILTIN_WORKFLOWS
+from aria.parser.modeling.storage import initialize_storage
+from aria.utils.imports import import_fullname
+from aria.utils.collections import OrderedDict
+
+from tests.parser.service_templates import consume_node_cellar
+
+
+WORKFLOW_POLICY_INTERNAL_PROPERTIES = ('function', 'implementation', 'dependencies')
+
+
+def test_install():
+ _workflow('install')
+
+
+def test_custom():
+ _workflow('maintenance_on')
+
+
+def _workflow(workflow_name):
+ context, _ = consume_node_cellar()
+
+ # TODO: this logic will eventually stabilize and be part of the ARIA API,
+ # likely somewhere in aria.orchestrator.workflows
+ if workflow_name in BUILTIN_WORKFLOWS:
+ workflow_fn = import_fullname('aria.orchestrator.workflows.builtin.' + workflow_name)
+ inputs = {}
+ else:
+ policy = context.modeling.instance.policies[workflow_name]
+ sys.path.append(policy.properties['implementation'].value)
+
+ workflow_fn = import_fullname(policy.properties['function'].value)
+ inputs = OrderedDict([
+ (k, v.value) for k, v in policy.properties.iteritems()
+ if k not in WORKFLOW_POLICY_INTERNAL_PROPERTIES
+ ])
+
+ def _initialize_storage(model_storage):
+ initialize_storage(context, model_storage, 1)
+
+ runner = Runner(workflow_name, workflow_fn, inputs, _initialize_storage, 1)
+ runner.run()
http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/88d6aa22/tests/orchestrator/test_complete.py
----------------------------------------------------------------------
diff --git a/tests/orchestrator/test_complete.py b/tests/orchestrator/test_complete.py
deleted file mode 100644
index a0a2000..0000000
--- a/tests/orchestrator/test_complete.py
+++ /dev/null
@@ -1,58 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements. See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-import sys
-
-from aria.orchestrator.runner import Runner
-from aria.orchestrator.workflows.builtin import BUILTIN_WORKFLOWS
-from aria.parser.modeling.storage import initialize_storage
-from aria.utils.imports import import_fullname
-from aria.utils.collections import OrderedDict
-
-from ..parser.service_templates import consume_node_cellar
-
-
-WORKFLOW_POLICY_INTERNAL_PROPERTIES = ('function', 'implementation', 'dependencies')
-
-
-def test_install():
- _workflow('install')
-
-
-def test_custom():
- _workflow('maintenance_on')
-
-
-def _workflow(workflow_name):
- context, _ = consume_node_cellar()
-
- if workflow_name in BUILTIN_WORKFLOWS:
- workflow_fn = import_fullname('aria.orchestrator.workflows.builtin.' + workflow_name)
- inputs = {}
- else:
- policy = context.modeling.instance.policies[workflow_name]
- sys.path.append(policy.properties['implementation'].value)
-
- workflow_fn = import_fullname(policy.properties['function'].value)
- inputs = OrderedDict([
- (k, v.value) for k, v in policy.properties.iteritems()
- if k not in WORKFLOW_POLICY_INTERNAL_PROPERTIES
- ])
-
- def _initialize_storage(model_storage):
- initialize_storage(context, model_storage, 1)
-
- runner = Runner(workflow_name, workflow_fn, inputs, _initialize_storage, 1)
- runner.run()
http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/88d6aa22/tests/parser/test_complete.py
----------------------------------------------------------------------
diff --git a/tests/parser/test_complete.py b/tests/parser/test_complete.py
deleted file mode 100644
index 4ea4a9c..0000000
--- a/tests/parser/test_complete.py
+++ /dev/null
@@ -1,40 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements. See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-from .service_templates import consume_node_cellar
-
-
-def test_validation():
- consume_node_cellar('validate')
-
-
-def test_validation_no_cache():
- consume_node_cellar('validate', False)
-
-
-def test_presentation():
- consume_node_cellar('presentation')
-
-
-def test_model():
- consume_node_cellar('model')
-
-
-def test_types():
- consume_node_cellar('types')
-
-
-def test_instance():
- consume_node_cellar('instance')
http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/88d6aa22/tests/resources/service_templates/node-cellar/node-cellar.yaml
----------------------------------------------------------------------
diff --git a/tests/resources/service_templates/node-cellar/node-cellar.yaml b/tests/resources/service_templates/node-cellar/node-cellar.yaml
index 8148b36..3e579bd 100644
--- a/tests/resources/service_templates/node-cellar/node-cellar.yaml
+++ b/tests/resources/service_templates/node-cellar/node-cellar.yaml
@@ -26,7 +26,7 @@ metadata:
template_name: node-cellar
template_author: ARIA
template_version: '1.0.0'
- aria_version: '1.0'
+ aria_version: '0.0'
imports:
- types/openstack.yaml
@@ -46,7 +46,7 @@ repositories:
node_cellar:
description: >-
The repository for the Node Cellar application and its dependencies.
- url: https://github.com/cloudify-cosmo/nodecellar/archive
+ url: https://github.com/ccoenraets/nodecellar/archive/
credential:
user: guest
token: ''
@@ -90,7 +90,7 @@ topology_template:
description: >-
The Node Cellar application package.
type: os.Archive
- file: master.tar.gz
+ file: master.zip
repository: node_cellar
deploy_path: /opt/nodejs/applications/node-cellar
properties: