You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openwhisk.apache.org by mr...@apache.org on 2017/09/07 15:24:17 UTC

[incubator-openwhisk-wskdeploy] branch master updated: Validating wskdeploy with different manifest and deployment files (#459)

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

mrutkowski pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-openwhisk-wskdeploy.git


The following commit(s) were added to refs/heads/master by this push:
     new 14240c6  Validating wskdeploy with different manifest and deployment files (#459)
14240c6 is described below

commit 14240c6e2e25f4b868705310956ff6b3388a36e7
Author: Priti Desai <pd...@us.ibm.com>
AuthorDate: Thu Sep 7 08:24:15 2017 -0700

    Validating wskdeploy with different manifest and deployment files (#459)
---
 .../actions/hello.js                               | 26 +++++++
 .../deployment.yaml                                |  9 +++
 .../deployment.yml                                 |  9 +++
 .../manifest.yaml                                  | 29 +++++++
 .../manifest.yml                                   | 29 +++++++
 .../not-standard-deployment.yaml                   |  9 +++
 .../not-standard-manifest.yaml                     | 29 +++++++
 .../random-name-1.yaml                             | 29 +++++++
 .../random-name-2.yaml                             |  9 +++
 .../validate-file-extensions_test.go               | 90 ++++++++++++++++++++++
 .../yaml-deployment-with-yml-manifest.yaml         |  9 +++
 .../yaml-manifest-with-yml-deployment.yaml         | 29 +++++++
 .../yml-deployment-with-yaml-manifest.yml          |  9 +++
 .../yml-manifest-with-yaml-deployment.yml          | 29 +++++++
 14 files changed, 344 insertions(+)

diff --git a/tests/src/integration/validate-manifest-deployment-file-extensions/actions/hello.js b/tests/src/integration/validate-manifest-deployment-file-extensions/actions/hello.js
new file mode 100644
index 0000000..25fdafb
--- /dev/null
+++ b/tests/src/integration/validate-manifest-deployment-file-extensions/actions/hello.js
@@ -0,0 +1,26 @@
+/*
+ * 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.
+ */
+
+/*
+ * Return a simple greeting message for the whole world.
+ */
+function main(params) {
+    msg = "Hello, " + params.name + " from " + params.place;
+    console.log(msg)
+    return { payload:  msg };
+}
+
diff --git a/tests/src/integration/validate-manifest-deployment-file-extensions/deployment.yaml b/tests/src/integration/validate-manifest-deployment-file-extensions/deployment.yaml
new file mode 100644
index 0000000..65252dc
--- /dev/null
+++ b/tests/src/integration/validate-manifest-deployment-file-extensions/deployment.yaml
@@ -0,0 +1,9 @@
+application:
+  name: IntegrationTest
+  packages:
+    ValidateYAMLExtension:
+      actions:
+        helloNodejs:
+          inputs:
+            name: Harvey
+            place: Houston
diff --git a/tests/src/integration/validate-manifest-deployment-file-extensions/deployment.yml b/tests/src/integration/validate-manifest-deployment-file-extensions/deployment.yml
new file mode 100644
index 0000000..4b57adc
--- /dev/null
+++ b/tests/src/integration/validate-manifest-deployment-file-extensions/deployment.yml
@@ -0,0 +1,9 @@
+application:
+  name: IntegrationTest
+  packages:
+    ValidateYMLExtension:
+      actions:
+        helloNodejs:
+          inputs:
+            name: Irma
+            place: Florida
diff --git a/tests/src/integration/validate-manifest-deployment-file-extensions/manifest.yaml b/tests/src/integration/validate-manifest-deployment-file-extensions/manifest.yaml
new file mode 100644
index 0000000..2b9d55a
--- /dev/null
+++ b/tests/src/integration/validate-manifest-deployment-file-extensions/manifest.yaml
@@ -0,0 +1,29 @@
+package:
+  name: ValidateYAMLExtension
+  actions:
+    # helloworld action in NodeJS
+    helloworld:
+      function: actions/hello.js
+      runtime: nodejs:6
+      inputs:
+        name:
+          type: string
+          description: name of a person
+        place:
+          type: string
+          description: location of a person
+      outputs:
+        payload:
+          type: string
+          description: a simple greeting message, Hello World!
+  triggers:
+    # trigger to activate helloworld action
+    trigger-for-valid-manifest-yaml:
+  rules:
+    # rule associating trigger with helloworld action
+    rule-for-valid-manifest-yaml:
+      trigger: trigger-for-valid-manifest-yaml
+      action: helloworld
+
+
+
diff --git a/tests/src/integration/validate-manifest-deployment-file-extensions/manifest.yml b/tests/src/integration/validate-manifest-deployment-file-extensions/manifest.yml
new file mode 100644
index 0000000..e7c1ddd
--- /dev/null
+++ b/tests/src/integration/validate-manifest-deployment-file-extensions/manifest.yml
@@ -0,0 +1,29 @@
+package:
+  name: ValidateYMLExtension
+  actions:
+    # helloworld action in NodeJS
+    helloworld:
+      function: actions/hello.js
+      runtime: nodejs:6
+      inputs:
+        name:
+          type: string
+          description: name of a person
+        place:
+          type: string
+          description: location of a person
+      outputs:
+        payload:
+          type: string
+          description: a simple greeting message, Hello World!
+  triggers:
+    # trigger to activate helloworld action
+    trigger-for-valid-manifest-yml:
+  rules:
+    # rule associating trigger with helloworld action
+    rule-for-valid-manifest-yml:
+      trigger: trigger-for-valid-manifest-yml
+      action: helloworld
+
+
+
diff --git a/tests/src/integration/validate-manifest-deployment-file-extensions/not-standard-deployment.yaml b/tests/src/integration/validate-manifest-deployment-file-extensions/not-standard-deployment.yaml
new file mode 100644
index 0000000..df79358
--- /dev/null
+++ b/tests/src/integration/validate-manifest-deployment-file-extensions/not-standard-deployment.yaml
@@ -0,0 +1,9 @@
+application:
+  name: IntegrationTest
+  packages:
+    ValidateNotStandardFileNames:
+      actions:
+        helloNodejs:
+          inputs:
+            name: Jose
+            place: Atlantic Ocean
diff --git a/tests/src/integration/validate-manifest-deployment-file-extensions/not-standard-manifest.yaml b/tests/src/integration/validate-manifest-deployment-file-extensions/not-standard-manifest.yaml
new file mode 100644
index 0000000..06b0de7
--- /dev/null
+++ b/tests/src/integration/validate-manifest-deployment-file-extensions/not-standard-manifest.yaml
@@ -0,0 +1,29 @@
+package:
+  name: ValidateNotStandardFileNames
+  actions:
+    # helloworld action in NodeJS
+    helloworld:
+      function: actions/hello.js
+      runtime: nodejs:6
+      inputs:
+        name:
+          type: string
+          description: name of a person
+        place:
+          type: string
+          description: location of a person
+      outputs:
+        payload:
+          type: string
+          description: a simple greeting message, Hello World!
+  triggers:
+    # trigger to activate helloworld action
+    trigger-for-not-standard-file-names:
+  rules:
+    # rule associating trigger with helloworld action
+    rule-for-not-standard-file-names:
+      trigger: trigger-for-not-standard-file-names
+      action: helloworld
+
+
+
diff --git a/tests/src/integration/validate-manifest-deployment-file-extensions/random-name-1.yaml b/tests/src/integration/validate-manifest-deployment-file-extensions/random-name-1.yaml
new file mode 100644
index 0000000..c4d7edc
--- /dev/null
+++ b/tests/src/integration/validate-manifest-deployment-file-extensions/random-name-1.yaml
@@ -0,0 +1,29 @@
+package:
+  name: ValidateRandomFileNames
+  actions:
+    # helloworld action in NodeJS
+    helloworld:
+      function: actions/hello.js
+      runtime: nodejs:6
+      inputs:
+        name:
+          type: string
+          description: name of a person
+        place:
+          type: string
+          description: location of a person
+      outputs:
+        payload:
+          type: string
+          description: a simple greeting message, Hello World!
+  triggers:
+    # trigger to activate helloworld action
+    trigger-for-random-file-names:
+  rules:
+    # rule associating trigger with helloworld action
+    rule-for-random-file-names:
+      trigger: trigger-for-random-file-names
+      action: helloworld
+
+
+
diff --git a/tests/src/integration/validate-manifest-deployment-file-extensions/random-name-2.yaml b/tests/src/integration/validate-manifest-deployment-file-extensions/random-name-2.yaml
new file mode 100644
index 0000000..1dc4f2d
--- /dev/null
+++ b/tests/src/integration/validate-manifest-deployment-file-extensions/random-name-2.yaml
@@ -0,0 +1,9 @@
+application:
+  name: IntegrationTest
+  packages:
+    ValidateRandomFileNames:
+      actions:
+        helloNodejs:
+          inputs:
+            name: Katia
+            place: Gulf of Mexico
diff --git a/tests/src/integration/validate-manifest-deployment-file-extensions/validate-file-extensions_test.go b/tests/src/integration/validate-manifest-deployment-file-extensions/validate-file-extensions_test.go
new file mode 100644
index 0000000..77c3e6e
--- /dev/null
+++ b/tests/src/integration/validate-manifest-deployment-file-extensions/validate-file-extensions_test.go
@@ -0,0 +1,90 @@
+// +build integration
+
+/*
+ * 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.
+ */
+
+package tests
+
+import (
+	"github.com/apache/incubator-openwhisk-wskdeploy/tests/src/integration/common"
+	"github.com/stretchr/testify/assert"
+	"os"
+	"testing"
+)
+
+var projectPath = "/src/github.com/apache/incubator-openwhisk-wskdeploy/tests/src/integration/validate-manifest-deployment-file-extensions/"
+
+func TestYAMLExtension(t *testing.T) {
+	manifestPath   := os.Getenv("GOPATH") + projectPath + "manifest.yaml"
+	deploymentPath := os.Getenv("GOPATH") + projectPath + "deployment.yaml"
+	wskdeploy := common.NewWskdeploy()
+	_, err := wskdeploy.Deploy(manifestPath, deploymentPath)
+	assert.Equal(t, nil, err, "Failed to deploy based on the manifest and deployment files with .yaml extension.")
+	_, err = wskdeploy.Undeploy(manifestPath, deploymentPath)
+	assert.Equal(t, nil, err, "Failed to undeploy based on the manifest and deployment files with .yaml extension.")
+}
+
+func TestYMLExtension(t *testing.T) {
+	manifestPath   := os.Getenv("GOPATH") + projectPath + "manifest.yml"
+	deploymentPath := os.Getenv("GOPATH") + projectPath + "deployment.yml"
+	wskdeploy := common.NewWskdeploy()
+	_, err := wskdeploy.Deploy(manifestPath, deploymentPath)
+	assert.Equal(t, nil, err, "Failed to deploy based on the manifest and deployment files with .yml extension.")
+	_, err = wskdeploy.Undeploy(manifestPath, deploymentPath)
+	assert.Equal(t, nil, err, "Failed to undeploy based on the manifest and deployment files with .yml extension.")
+}
+
+func TestNonStandardFileNames(t *testing.T) {
+	manifestPath   := os.Getenv("GOPATH") + projectPath + "not-standard-manifest.yaml"
+	deploymentPath := os.Getenv("GOPATH") + projectPath + "not-standard-deployment.yaml"
+	wskdeploy := common.NewWskdeploy()
+	_, err := wskdeploy.Deploy(manifestPath, deploymentPath)
+	assert.Equal(t, nil, err, "Failed to deploy based on the manifest and deployment files with non standard names.")
+	_, err = wskdeploy.Undeploy(manifestPath, deploymentPath)
+	assert.Equal(t, nil, err, "Failed to undeploy based on the manifest and deployment files with non standard names.")
+}
+
+func TestRandomFileNames(t *testing.T) {
+	manifestPath   := os.Getenv("GOPATH") + projectPath + "random-name-1.yaml"
+	deploymentPath := os.Getenv("GOPATH") + projectPath + "random-name-2.yaml"
+	wskdeploy := common.NewWskdeploy()
+	_, err := wskdeploy.Deploy(manifestPath, deploymentPath)
+	assert.Equal(t, nil, err, "Failed to deploy based on the manifest and deployment files with random names.")
+	_, err = wskdeploy.Undeploy(manifestPath, deploymentPath)
+	assert.Equal(t, nil, err, "Failed to undeploy based on the manifest and deployment files with random names.")
+}
+
+func TestYAMLManifestWithYMLDeployment(t *testing.T) {
+	manifestPath   := os.Getenv("GOPATH") + projectPath + "yaml-manifest-with-yml-deployment.yaml"
+	deploymentPath := os.Getenv("GOPATH") + projectPath + "yml-deployment-with-yaml-manifest.yml"
+	wskdeploy := common.NewWskdeploy()
+	_, err := wskdeploy.Deploy(manifestPath, deploymentPath)
+	assert.Equal(t, nil, err, "Failed to deploy based on the manifest and deployment files with mix of .yaml and .yml extensions.")
+	_, err = wskdeploy.Undeploy(manifestPath, deploymentPath)
+	assert.Equal(t, nil, err, "Failed to undeploy based on the manifest and deployment files with mix of .yaml and .yml extension.")
+}
+
+func TestYMLManifestWithYAMLDeployment(t *testing.T) {
+	manifestPath   := os.Getenv("GOPATH") + projectPath + "yml-manifest-with-yaml-deployment.yml"
+	deploymentPath := os.Getenv("GOPATH") + projectPath + "yaml-deployment-with-yml-manifest.yaml"
+	wskdeploy := common.NewWskdeploy()
+	_, err := wskdeploy.Deploy(manifestPath, deploymentPath)
+	assert.Equal(t, nil, err, "Failed to deploy based on the manifest and deployment files with .yml manifest and .yaml deployment file.")
+	_, err = wskdeploy.Undeploy(manifestPath, deploymentPath)
+	assert.Equal(t, nil, err, "Failed to undeploy based on the manifest and deployment files with .yml manifest and .yaml deployment file.")
+}
+
diff --git a/tests/src/integration/validate-manifest-deployment-file-extensions/yaml-deployment-with-yml-manifest.yaml b/tests/src/integration/validate-manifest-deployment-file-extensions/yaml-deployment-with-yml-manifest.yaml
new file mode 100644
index 0000000..82d6086
--- /dev/null
+++ b/tests/src/integration/validate-manifest-deployment-file-extensions/yaml-deployment-with-yml-manifest.yaml
@@ -0,0 +1,9 @@
+application:
+  name: IntegrationTest
+  packages:
+    ValidateYMLManifestWithYAMLDeployment:
+      actions:
+        helloNodejs:
+          inputs:
+            name: Harvey
+            place: Houston
diff --git a/tests/src/integration/validate-manifest-deployment-file-extensions/yaml-manifest-with-yml-deployment.yaml b/tests/src/integration/validate-manifest-deployment-file-extensions/yaml-manifest-with-yml-deployment.yaml
new file mode 100644
index 0000000..99c1497
--- /dev/null
+++ b/tests/src/integration/validate-manifest-deployment-file-extensions/yaml-manifest-with-yml-deployment.yaml
@@ -0,0 +1,29 @@
+package:
+  name: ValidateYAMLManifestWithYMLDeployment
+  actions:
+    # helloworld action in NodeJS
+    helloworld:
+      function: actions/hello.js
+      runtime: nodejs:6
+      inputs:
+        name:
+          type: string
+          description: name of a person
+        place:
+          type: string
+          description: location of a person
+      outputs:
+        payload:
+          type: string
+          description: a simple greeting message, Hello World!
+  triggers:
+    # trigger to activate helloworld action
+    trigger-for-yaml-manifest-yml-deployment:
+  rules:
+    # rule associating trigger with helloworld action
+    rule-for-yaml-manifest-yml-deployment:
+      trigger: trigger-for-yaml-manifest-yml-deployment
+      action: helloworld
+
+
+
diff --git a/tests/src/integration/validate-manifest-deployment-file-extensions/yml-deployment-with-yaml-manifest.yml b/tests/src/integration/validate-manifest-deployment-file-extensions/yml-deployment-with-yaml-manifest.yml
new file mode 100644
index 0000000..587a3a1
--- /dev/null
+++ b/tests/src/integration/validate-manifest-deployment-file-extensions/yml-deployment-with-yaml-manifest.yml
@@ -0,0 +1,9 @@
+application:
+  name: IntegrationTest
+  packages:
+    ValidateYAMLManifestWithYMLDeployment:
+      actions:
+        helloNodejs:
+          inputs:
+            name: Harvey
+            place: Houston
diff --git a/tests/src/integration/validate-manifest-deployment-file-extensions/yml-manifest-with-yaml-deployment.yml b/tests/src/integration/validate-manifest-deployment-file-extensions/yml-manifest-with-yaml-deployment.yml
new file mode 100644
index 0000000..7631ae9
--- /dev/null
+++ b/tests/src/integration/validate-manifest-deployment-file-extensions/yml-manifest-with-yaml-deployment.yml
@@ -0,0 +1,29 @@
+package:
+  name: ValidateYMLManifestWithYAMLDeployment
+  actions:
+    # helloworld action in NodeJS
+    helloworld:
+      function: actions/hello.js
+      runtime: nodejs:6
+      inputs:
+        name:
+          type: string
+          description: name of a person
+        place:
+          type: string
+          description: location of a person
+      outputs:
+        payload:
+          type: string
+          description: a simple greeting message, Hello World!
+  triggers:
+    # trigger to activate helloworld action
+    trigger-for-yml-manifest-yaml-deployment:
+  rules:
+    # rule associating trigger with helloworld action
+    rule-for-yml-manifest-yaml-deployment:
+      trigger: trigger-for-yml-manifest-yaml-deployment
+      action: helloworld
+
+
+

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