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

[incubator-openwhisk-wskdeploy] branch master updated: Cleanup usecases (#457)

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

lz1982 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 1ced630  Cleanup usecases (#457)
1ced630 is described below

commit 1ced630b65e77108d5c56d93381bb5ccacc4ff2d
Author: Priti Desai <pd...@us.ibm.com>
AuthorDate: Wed Sep 6 22:41:10 2017 -0700

    Cleanup usecases (#457)
    
    * Fix issue web action annotation are not set #313.
    
    * Cleaning up usecases
    
    * Updating test case as we are adding support for web action
---
 deployers/deploymentreader_test.go                 |   6 +-
 parsers/manifest_parser.go                         |   2 +-
 parsers/manifest_parser_test.go                    |   3 -
 tests/README.md                                    |  78 +++++++----
 tests/dat/actions/hello.js                         |  26 ++++
 .../dat/deployment_validate_deployment_reader.yaml |   9 ++
 tests/dat/manifest_validate_deployment_reader.yaml |  18 +++
 .../usecases/defaulttest-bindings/deployment.yaml  |  10 --
 tests/usecases/defaulttest-bindings/greeting.js    |  11 --
 tests/usecases/defaulttest-bindings/httpGet.swift  |  51 --------
 tests/usecases/defaulttest-bindings/manifest.yaml  |   2 -
 tests/usecases/defaulttest/greeting.js             |  11 --
 tests/usecases/defaulttest/httpGet.swift           |  51 --------
 tests/usecases/defaulttest/manifest.yaml           |   2 -
 tests/usecases/openstack/actions/callSlack.js      |  74 -----------
 tests/usecases/openstack/actions/createBackup.js   | 133 -------------------
 tests/usecases/openstack/actions/getApiToken.js    | 143 ---------------------
 tests/usecases/openstack/actions/getServers.js     |  87 -------------
 tests/usecases/openstack/deployment.properties     |  15 ---
 tests/usecases/openstack/deployment.yaml           |  36 ------
 tests/usecases/openstack/manifest.yaml             |  36 ------
 tests/usecases/opentest/manifest.yaml              |   8 --
 tests/usecases/triggerrule/README.md               |  27 ++--
 tests/usecases/triggerrule/deployment.yml          |   4 +-
 24 files changed, 126 insertions(+), 717 deletions(-)

diff --git a/deployers/deploymentreader_test.go b/deployers/deploymentreader_test.go
index 5b2fe03..97fe936 100644
--- a/deployers/deploymentreader_test.go
+++ b/deployers/deploymentreader_test.go
@@ -26,8 +26,8 @@ import (
 
 var sd *ServiceDeployer
 var dr *DeploymentReader
-var deployment_file = "../tests/usecases/openstack/deployment.yaml"
-var manifest_file = "../tests/usecases/openstack/manifest.yaml"
+var deployment_file = "../tests/usecases/github/deployment.yaml"
+var manifest_file = "../tests/usecases/github/manifest.yaml"
 
 func init() {
 	sd = NewServiceDeployer()
@@ -40,7 +40,7 @@ func init() {
 // Check DeploymentReader could handle deployment yaml successfully.
 func TestDeploymentReader_HandleYaml(t *testing.T) {
 	dr.HandleYaml()
-	assert.NotNil(t, dr.DeploymentDescriptor.Application.Packages["JiraBackupSolution"], "DeploymentReader handle deployment yaml failed.")
+	assert.NotNil(t, dr.DeploymentDescriptor.Application.Packages["GitHubCommits"], "DeploymentReader handle deployment yaml failed.")
 }
 
 func TestDeployerCheck(t *testing.T) {
diff --git a/parsers/manifest_parser.go b/parsers/manifest_parser.go
index 8c9cc1e..8cfca53 100644
--- a/parsers/manifest_parser.go
+++ b/parsers/manifest_parser.go
@@ -340,7 +340,7 @@ func (dm *YAMLParser) ComposeActions(mani *ManifestYAML, manipath string) (ar []
 		}
 
 		// only set the webaction when the annotations are not empty.
-		if len(keyValArr) > 0 && action.Webexport == "true" {
+		if action.Webexport == "true" {
 			//wskaction.Annotations = keyValArr
 			wskaction.Annotations, err = utils.WebAction("yes", keyValArr, action.Name, false)
 			utils.Check(err)
diff --git a/parsers/manifest_parser_test.go b/parsers/manifest_parser_test.go
index 807d924..10ea8ad 100644
--- a/parsers/manifest_parser_test.go
+++ b/parsers/manifest_parser_test.go
@@ -787,10 +787,7 @@ func TestComposeActionsForWebActions(t *testing.T) {
   actions:
     hello:
       function: ../tests/src/integration/helloworld/actions/hello.js
-      annotations:
-        foo: bar
       web-export: true`
-	// (TODO) remove annotations from manifest file after we fix issue # 313
 	dir, _ := os.Getwd()
 	tmpfile, err := ioutil.TempFile(dir, "manifest_parser_validate_web_actions_")
 	if err == nil {
diff --git a/tests/README.md b/tests/README.md
index e13d536..79e20a0 100644
--- a/tests/README.md
+++ b/tests/README.md
@@ -1,6 +1,10 @@
-# Test cases for openwhisk-wskdeploy.
+# Test Cases for wskdeploy.
 
-There are two types of test cases located under the 'tests': unit and integration. You can identify them by the first line of each test case file. Unit tests are tagged with "+build unit" and integration tests are tagged with "+build integration". For example, the test file deploymentreader_test.go under tests/src/deployers contains unit test cases, so it is indicated with the unit tag on the top of the file:
+There are two types of test cases supported (1) unit test and (2) integration test.
+You can identify them by the first line of each test file. Unit tests are tagged
+with `+build unit` and integration tests are tagged with `+build integration`.
+For example, the test file `deploymentreader_test.go` under `deployers/` contains
+unit test cases, so it is indicated with the unit tests tag on the top of the file:
 
 ```
 // +build unit
@@ -9,7 +13,7 @@ package tests
 ...
 ```
 
-Integration tests are indicated with the integration tag on the top of the file:
+Integration tests are indicated with the integration tests tag on the top of the file:
 ```
 // +build integration
 
@@ -17,53 +21,75 @@ package tests
 ...
 ```
 
-# How to run wskdeploy tests
+## How to run wskdeploy tests
+
+Before running unit or integration tests, you need to install the package
+[Testify](https://github.com/stretchr/testify/):
 
-Before running unit or integration tests, you need to install the package [Testify](https://github.com/stretchr/testify/) before running the test cases:
 ```
 cd $GOPATH
 go get -u github.com/stretchr/testify
 
 ```
 
-## Running unit tests
+### Running Unit Tests
 
-After installing Testify, all the unit tests can be run from the main 'incubator-openwhisk-wskdeploy' repository folder using the following command:
+After installing Testify, all the unit tests can be run from the main `incubator-openwhisk-wskdeploy`
+repository folder using the following command:
 
 ```
 $ go test -v ./... -tags unit
 ```
 
-## Running integration tests
+### Running Integration Tests
 
-After installing Testify, all integration tests can be run rom the main 'incubator-openwhisk-wskdeploy' repository folder using the following command:
+After installing Testify, all integration tests can be run rom the main `incubator-openwhisk-wskdeploy`
+repository folder using the following command:
 
 ```
 $ go test -v ./... -tags integration
 ```
 
-# How to structure the test cases
+### Run an Individual Test
+
+```
+go test -v <path-to-package-dir> -tags unit -run <test-name>
+```
 
-All integration test cases are put under the folder 'tests/src/integration'.
+For example:
 
-Unit tests are co-located in the same directory as the package they are testing (by Go convention). The test files would use the same basename as the file that contains the package they are providing tests for, but with the added '_test' postfix to the base file name.
+```
+go test -v ./parsers/ -tags unit -run TestComposeActionsForWebActions
+go test -v ./tests/src/integration/zipaction/ -tags integration
+```
 
-For example, the package 'deployers', which defines a 'DeploymentReader' service, is declared in the file 'deploymentreader.go'; its corresponding unit test is in the file named 'deploymentreader_test.go' in the same directory.
+## How to Structure Unit Tests
 
-## Grouping tests
+All integration test cases are put under the folder `tests/src/integration`.
 
-Additional unit tests can be grouped into different packages, and they can be put under a subfolder
-named after the package under 'tests/src'. The yaml files of manifest and deployment used by unit tests are put under 'tests/data'.
+Unit tests are co-located in the same directory as the package being tested (by Go convention).
+The test files uses the same basename as the file that contains the package,
+but with the added '_test' postfix to the base file name.
 
-Different integration tests can be grouped into different packages as well, and they can be put under a subfolder named after the package under 'tests/src/integration'. The yaml files of manifest and deployment used by the integration test are put under the same subfolder as the integration test itself. The source file used by the manifest file can be put under the folder 'tests/src/integration/<package>/src'.
+For example, the package `deployers`, which defines a `DeploymentReader` service,
+is declared in the file `deploymentreader.go`; its corresponding unit test file
+should be named `deploymentreader_test.go` under `deployers/`.
 
-# Unit test listing
+Also, the manifest and deployment YAML files used by unit tests should go under `tests/dat`.
 
-| Test File | Manifest | Deployment | Description |
-| ------| ------ | ------ | ------ |
-| [deployers / deploymentreader_test.go](https://github.com/apache/incubator-openwhisk-wskdeploy/blob/master/deployers/deploymentreader_test.go) | usecases/badyaml/manifest.yaml | usecases/badyaml/deployment.yaml| Tests DeploymentReader service. |
-| [deployers / manifestreader_test.go](https://github.com/apache/incubator-openwhisk-wskdeploy/blob/master/deployers/manifestreader_test.go) | dat/manifest6.yaml | N/A | Tests ManifestReader service |
-| [utils / utils_test.go](https://github.com/apache/incubator-openwhisk-wskdeploy/blob/master/utils/util_test.go) | N/A | dat/deployment.yaml| Tests ContentReader, ReadUrl |
-| [cmd / root_test.go](https://github.com/apache/incubator-openwhisk-wskdeploy/blob/master/cmd/root_test.go) | N/A | N/A | Tests Cobra frameworks "Root" command (i.e., "wskdeploy") and its child commands|
-| [parsers / yamlparser_test.go](https://github.com/apache/incubator-openwhisk-wskdeploy/blob/master/parsers/yamlparser_test.go) | dat/manifest1.yaml, dat/manifest2.yaml, dat/manifest3.yaml, dat/manifest4.yaml, dat/manifest5.yaml, dat/manifest6.yaml | dat/deploy1.yaml, dat/deploy2.yaml, dat/deploy3.yaml, dat/deploy4.yaml | Tests YAML parser against various Manifest and Deployment files. |
-<!-- | []() | <manifest> | <depl> | <desc> | -->
+## How to Structure Integration Tests
+
+Every integration test has to have a test file 
+Integration tests are created under `tests/src/integration`. The test file and
+manifest and deployment YAML files should go under the same directory.
+
+For example, `helloworld` integration test:
+
+```
+ls -1 tests/src/integration/helloworld/
+README.md
+actions/
+deployment.yaml
+helloworld_test.go
+manifest.yaml
+```
diff --git a/tests/dat/actions/hello.js b/tests/dat/actions/hello.js
new file mode 100644
index 0000000..25fdafb
--- /dev/null
+++ b/tests/dat/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/dat/deployment_validate_deployment_reader.yaml b/tests/dat/deployment_validate_deployment_reader.yaml
new file mode 100644
index 0000000..fd18d2b
--- /dev/null
+++ b/tests/dat/deployment_validate_deployment_reader.yaml
@@ -0,0 +1,9 @@
+application:
+  name: UnitTestDeployers
+  packages:
+    ValidateDeploymentReader:
+      actions:
+        helloNodejs:
+          inputs:
+            name: Amy
+            place: Paris
diff --git a/tests/dat/manifest_validate_deployment_reader.yaml b/tests/dat/manifest_validate_deployment_reader.yaml
new file mode 100644
index 0000000..b9a1970
--- /dev/null
+++ b/tests/dat/manifest_validate_deployment_reader.yaml
@@ -0,0 +1,18 @@
+package:
+  name: ValidateDeploymentReader
+  actions:
+    # helloworld action in NodeJS
+    helloNodejs:
+      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!
diff --git a/tests/usecases/defaulttest-bindings/deployment.yaml b/tests/usecases/defaulttest-bindings/deployment.yaml
deleted file mode 100644
index fd243a2..0000000
--- a/tests/usecases/defaulttest-bindings/deployment.yaml
+++ /dev/null
@@ -1,10 +0,0 @@
-application:
-  name: myHello
-  namespace: _
-  version: 0.0.1
-  packages:
-    name: defaulttest
-    actions:
-      greeting:
-        inputs:
-          name: Paul
\ No newline at end of file
diff --git a/tests/usecases/defaulttest-bindings/greeting.js b/tests/usecases/defaulttest-bindings/greeting.js
deleted file mode 100644
index eaa6834..0000000
--- a/tests/usecases/defaulttest-bindings/greeting.js
+++ /dev/null
@@ -1,11 +0,0 @@
-/**
- * Return a simple greeting message for someone.
- *
- * @param name A person's name.
- * @param place Where the person is from.
- */
-function main(params) {
-    var name = params.name || params.payload || 'stranger';
-    var place = params.place || 'somewhere';
-    return {payload:  'Hello, ' + name + ' from ' + place + '!'};
-}
diff --git a/tests/usecases/defaulttest-bindings/httpGet.swift b/tests/usecases/defaulttest-bindings/httpGet.swift
deleted file mode 100644
index a870bc5..0000000
--- a/tests/usecases/defaulttest-bindings/httpGet.swift
+++ /dev/null
@@ -1,51 +0,0 @@
-/**
- * Sample code using the experimental Swift 3 runtime
- * with links to KituraNet and GCD
- */
-
-import KituraNet
-import Dispatch
-import Foundation
-import SwiftyJSON
-
-func main(args:[String:Any]) -> [String:Any] {
-    
-    // Force KituraNet call to run synchronously on a global queue
-    var str = "No response"
-    
-    HTTP.get("https://httpbin.org/get") { response in
-        do {
-            str = try response!.readString()!
-        } catch {
-            print("Error \(error)")
-        }
-    }
-    
-    
-    // Assume string is JSON
-    print("Got string \(str)")
-    var result:[String:Any]?
-    
-    // Convert to NSData
-    let data = str.data(using: String.Encoding.utf8, allowLossyConversion: true)!
-    
-    // test SwiftyJSON
-    let json = JSON(data: data)
-    if let jsonUrl = json["url"].string {
-        print("Got json url \(jsonUrl)")
-    } else {
-        print("JSON DID NOT PARSE")
-    }
-    
-    // create result object to return
-    
-    do {
-        
-        result = try JSONSerialization.jsonObject(with: data, options: [])  as? [String:Any]      } catch {
-            print("Error \(error)")
-    }
-    
-    // return, which should be a dictionary
-    print("Result is \(result!)")
-    return result!
-}
diff --git a/tests/usecases/defaulttest-bindings/manifest.yaml b/tests/usecases/defaulttest-bindings/manifest.yaml
deleted file mode 100644
index e00d906..0000000
--- a/tests/usecases/defaulttest-bindings/manifest.yaml
+++ /dev/null
@@ -1,2 +0,0 @@
-package:
-  name: defaulttest
\ No newline at end of file
diff --git a/tests/usecases/defaulttest/greeting.js b/tests/usecases/defaulttest/greeting.js
deleted file mode 100644
index eaa6834..0000000
--- a/tests/usecases/defaulttest/greeting.js
+++ /dev/null
@@ -1,11 +0,0 @@
-/**
- * Return a simple greeting message for someone.
- *
- * @param name A person's name.
- * @param place Where the person is from.
- */
-function main(params) {
-    var name = params.name || params.payload || 'stranger';
-    var place = params.place || 'somewhere';
-    return {payload:  'Hello, ' + name + ' from ' + place + '!'};
-}
diff --git a/tests/usecases/defaulttest/httpGet.swift b/tests/usecases/defaulttest/httpGet.swift
deleted file mode 100644
index a870bc5..0000000
--- a/tests/usecases/defaulttest/httpGet.swift
+++ /dev/null
@@ -1,51 +0,0 @@
-/**
- * Sample code using the experimental Swift 3 runtime
- * with links to KituraNet and GCD
- */
-
-import KituraNet
-import Dispatch
-import Foundation
-import SwiftyJSON
-
-func main(args:[String:Any]) -> [String:Any] {
-    
-    // Force KituraNet call to run synchronously on a global queue
-    var str = "No response"
-    
-    HTTP.get("https://httpbin.org/get") { response in
-        do {
-            str = try response!.readString()!
-        } catch {
-            print("Error \(error)")
-        }
-    }
-    
-    
-    // Assume string is JSON
-    print("Got string \(str)")
-    var result:[String:Any]?
-    
-    // Convert to NSData
-    let data = str.data(using: String.Encoding.utf8, allowLossyConversion: true)!
-    
-    // test SwiftyJSON
-    let json = JSON(data: data)
-    if let jsonUrl = json["url"].string {
-        print("Got json url \(jsonUrl)")
-    } else {
-        print("JSON DID NOT PARSE")
-    }
-    
-    // create result object to return
-    
-    do {
-        
-        result = try JSONSerialization.jsonObject(with: data, options: [])  as? [String:Any]      } catch {
-            print("Error \(error)")
-    }
-    
-    // return, which should be a dictionary
-    print("Result is \(result!)")
-    return result!
-}
diff --git a/tests/usecases/defaulttest/manifest.yaml b/tests/usecases/defaulttest/manifest.yaml
deleted file mode 100644
index e00d906..0000000
--- a/tests/usecases/defaulttest/manifest.yaml
+++ /dev/null
@@ -1,2 +0,0 @@
-package:
-  name: defaulttest
\ No newline at end of file
diff --git a/tests/usecases/openstack/actions/callSlack.js b/tests/usecases/openstack/actions/callSlack.js
deleted file mode 100644
index e6c7916..0000000
--- a/tests/usecases/openstack/actions/callSlack.js
+++ /dev/null
@@ -1,74 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one or more contributor
-// license agreements; and to You under the Apache License, Version 2.0.
-
-////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-//
-//  Post Slack Message
-//
-//  @param apiToken apiToken retrieved from Keystone
-//
-/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-
-var request = require('request');
-
-//var whisk = { console: console };
-//main({url: 'https://hooks.slack.com/services/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', channel: '#platform-alerts', username: 'WhiskBot', icon: ':exclamation:', title: 'title', content: 'content'});
-
-function main(msg) {
-    var postPromise = post(msg.url,
-         msg.channel, {
-         username : msg.username || 'whisk',
-         icon : msg.icon || ':openwhisk:',
-         status : msg.status || 'good',
-         title : msg.title || '',
-         content : msg.content || ''
-    });
-
-    return postPromise;
-}
-
-function colorForStatus(status) {
-    if (status === 'good' || status === 'danger')
-        return status;
-    else if (status === 'warning')
-        return '#FF9900';
-    else
-        return '#3333FF';
-}
-
-function post(url, channel, msg) {
-    var form = {
-        channel : channel,
-        username : msg.username,
-        icon_emoji : msg.icon,
-        mrkdwn_in : [ 'fields' ],
-        attachments : [ {
-            fallback : msg.content,
-            color : colorForStatus(msg.status),
-            fields : [ {
-                title : msg.title,
-                value : msg.content,
-                short : false
-            } ]
-        } ]
-    };
-
-    return new Promise(function(resolve, reject) {
-      request.post({
-          url : url,
-          formData : {
-              payload : JSON.stringify(form)
-          }
-      }, function(error, response, body) {
-          if (!error && response.statusCode == 200 && body == 'ok') {
-              console.log('posted', msg.content, 'to slack');
-              resolve();
-          } else {
-              console.log('[error]', error, body);
-              reject(error);
-          }
-      });
-    });
-}
diff --git a/tests/usecases/openstack/actions/createBackup.js b/tests/usecases/openstack/actions/createBackup.js
deleted file mode 100644
index 730cbed..0000000
--- a/tests/usecases/openstack/actions/createBackup.js
+++ /dev/null
@@ -1,133 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one or more contributor
-// license agreements; and to You under the Apache License, Version 2.0.
-
-////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-//
-//  Create a snapshot of a server
-//
-//  @param apiToken apiToken retrieved from Keystone
-//
-//  http://developer.openstack.org/api-ref/compute/?expanded=create-server-back-up-createbackup-action-detail
-//
-/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-
-
-var request = require('request')
-
-function pad(n){return (n < 10? '0' : '') + n;}
-
-function main(params) {
-
-    console.log('createNewSnapshot. got params '+JSON.stringify(params))
-
-     if (!params.apiToken) {
-        return {"msg" : "Missing apiToken"}
-    }
-     if (!params.apiEndpoint) {
-        return {"msg" : "Missing apiEndpoint"}
-    }
-     if (!params.serverId ) {
-        return {"msg" : "Missing snapshot serverId"}
-    }
-
-    if (!params.context) {
-        return {"msg" : "Missing context"}
-    }
-
-    if (!params.context.backupName) {
-        return {"msg" : "Missing backup name"}
-    }
-
-    if (!params.context.backupType) {
-        return {"msg" : "Missing backup type"}
-    }
-
-    if (!params.context.rotation) {
-        return {"msg" : "Missing rotation"}
-    }
-
-    var apiEndpoint = params.apiEndpoint
-    var apiToken = params.apiToken
-    var serverId = params.serverId
-    var backupName = params.context.backupName
-    var backupType = params.context.backupType
-    var rotation = params.context.rotation
-
-
-
-    d = new Date();
-    d.setUTCHours(d.getUTCHours() - 5);
-    var backupDate = d.getUTCFullYear() + '-' + pad(d.getUTCMonth() + 1) + '-' + pad(d.getUTCDate()) + 'T' + pad(d.getUTCHours()) + ':' + pad(d.getUTCMinutes())
-    console.log('Backup Date : ' + backupDate)
-
-    var backupNameDate = backupName + '.' + backupDate
-
-    console.log('createNewSnapshot params ' + JSON.stringify(params))
-
-    var context = null
-    if (params.context) {
-        context = params.context
-    }
-
-    var headers = {
-        'X-Auth-Token': apiToken,
-        'content-type': 'application/json'
-    };
-
-    //May be a better way to parse this
-    var post_data = {
-        createBackup: {
-            name: backupNameDate,
-            backup_type: backupType,
-            rotation: rotation
-        }
-    };
-
-    var url = apiEndpoint+'/servers/'+serverId+'/action'
-
-    // hardcode for now
-    var options = {
-        method: 'POST',
-        json: post_data,
-        headers: headers
-    };
-
-
-    var headers = {
-        'X-Auth-Token':apiToken
-    };
-
-    console.log('Options are : '+ JSON.stringify(options))
-
-    return new Promise(function(resolve, reject) {
-        request(url, options, function(error, res, body) {
-
-
-            if (error) {
-                var strContent = "Error occured in backing up server: " + backupName + "(" + serverId + "). Error: " + JSON.stringify(error)
-                reject({ status: "danger",  title: "Backup Report", content: strContent})
-            } else if (res.statusCode >= 400) {
-                for (var key in body) {
-                    if (body.hasOwnProperty(key)) {
-                        var strCode = body[key].code
-                        var strError = key
-                        var strMsg = body[key].message
-                    }
-                }
-                var strContent = "Server: " + backupName + "(" + serverId + "). \nCode: " + strCode + "\nWarning: " + strError + "\nMessage: " + strMsg
-                var strStatus = "warning"
-            } else {
-                var strContent = "Backup complete for server: " + backupName + "(" + serverId + ")"
-                var strStatus = "good"
-            }
-
-            console.log('Response Code: ' + res.statusCode + ' Body: '+ JSON.stringify(body))
-
-            resolve({ status: strStatus,  title: "Backup Report", content: strContent })
-        });
-
-    });
-
-}
diff --git a/tests/usecases/openstack/actions/getApiToken.js b/tests/usecases/openstack/actions/getApiToken.js
deleted file mode 100644
index 735115e..0000000
--- a/tests/usecases/openstack/actions/getApiToken.js
+++ /dev/null
@@ -1,143 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one or more contributor
-// license agreements; and to You under the Apache License, Version 2.0.
-
-////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-//
-//  Get Auth Token from Keystone
-//
-//  Will retrieve the auth token and storage URL for the object store service.  Uses V3 of the auth calls
-//
-//  The params object should look like:
-//
-//  "userId":"f45adsa0d0478c", "password":"sd2rsS^kdfsd", "projectId":"11fdseerff"}
-//
-//  @param userId: user id (not user name)
-//  @param password: password
-//  @param projectId: project/tenantId
-//  @param host: hostname of keystone endpoint (don't include 'https://')
-//  @param port: port of keystone endpoint
-//  @param endpointName: the name of the public endpoint service you want (nova, swift, etc)
-//
-//
-/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-
-
-var request = require('request')
-var url = require('url')
-
-function main(params) {
-
-    if (!params.userId || !params.password || !params.projectId || !params.host || !params.port || !params.endpointName) {
-        return {"msg" : "Missing required parameters"}
-    }
-
-    console.log('getApiToken. Params '+JSON.stringify(params))
-
-    var userId = params.userId
-    var password = params.password
-    var projectId = params.projectId
-    var pathPrefix = ""
-    var host = params.host
-    var port = params.port
-    var endpointName = params.endpointName
-
-    // customize your path here.
-    if (params.pathPrefix) {
-        pathPrefix = params.pathPrefix
-    }
-
-    var endpointUrl = 'https://' + host + ':' + port + '/v3/auth/tokens'
-
-    var context = null
-    if (params.context) {
-        context = params.context
-    }
-
-
-    var body = {
-    "auth": {
-        "identity": {
-            "methods": [
-                "password"
-            ],
-            "password": {
-                "user": {
-                    "id": userId,
-                    "password": password
-                }
-            }
-        },
-        "scope": {
-            "project": {
-                "id": projectId
-            }
-        }
-    }
-}
-
-    var headers = {
-       'Content-Type': 'application/json',
-       'Content-Length': Buffer.byteLength(JSON.stringify(body), ['utf8'])
-    };
-
-    var options = {
-        method: 'POST',
-        headers: headers,
-        json: body
-    };
-
-    console.log("got options "+ JSON.stringify(options))
-
-    return new Promise(function(resolve, reject) {
-        request(endpointUrl, options, function (error, response, body) {
-            //console.log(body)
-            if (!error) {
-
-                var authToken = response.headers['x-subject-token']
-
-                var j = body
-                var entries = j.token.catalog
-
-                for (var i = 0; i < entries.length; i++) {
-                    var entry = entries[i]
-                    console.log('Comparing '+ entry.name + " with "+endpointName)
-                    if (entry.name === endpointName) {
-                        var endpoints = entry.endpoints
-
-                        console.log('Got endpoints '+endpoints)
-                        for (var j = 0; j < endpoints.length; j++) {
-                            var endpoint = endpoints[j]
-                            if (endpoint.interface === 'public') {
-                                console.log('Public endpoint is ' + endpoint.url)
-                                console.log('Auth token is ' + authToken)
-
-                                var urlParts = url.parse(endpoint.url,true)
-
-                                var jsonResponse = {apiToken: authToken,
-                                    endpointUrl: endpoint.url,
-                                    host: urlParts.hostname,
-                                    port: urlParts.port,
-                                    path: urlParts.path,
-                                    protocol: urlParts.protocol}
-
-                                if (context) {
-                                    jsonResponse.context = context
-                                }
-
-                                return resolve(jsonResponse)
-                            }
-                        }
-                    }
-            }
-
-            reject({'msg': 'Cannot find public endpoint in response from keystone'})
-
-            } else {
-                reject(error)
-            }
-        });
-
-    });
-}
diff --git a/tests/usecases/openstack/actions/getServers.js b/tests/usecases/openstack/actions/getServers.js
deleted file mode 100644
index 3b34951..0000000
--- a/tests/usecases/openstack/actions/getServers.js
+++ /dev/null
@@ -1,87 +0,0 @@
-
-// Licensed to the Apache Software Foundation (ASF) under one or more contributor
-// license agreements; and to You under the Apache License, Version 2.0.
-
-////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-//
-//  Get Servers from Nova
-//
-//  Will retrieve a list of filtered servers from Nova.
-//
-//  @param apiToken apiToken retrieved from Keystone
-//
-/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-
-
-var request = require('request')
-
-function main(params) {
-
-    if (!params.apiToken || !params.host || !params.port || !params.path || !params.protocol) {
-        return {"msg" : "Missing required params"}
-    }
-
-    console.log('Got params ' + JSON.stringify(params))
-
-    var apiToken = params.apiToken
-    var host = params.host
-    var port = params.port
-    var path = params.path
-    var protocol = params.protocol
-
-
-    var context = null
-    if (params.context) {
-        context = params.context
-    }
-
-    var headers = {
-        'X-Auth-Token':apiToken
-    };
-
-    var apiEndpoint = protocol+'//'+host+':'+port+path
-
-   var url = apiEndpoint+'/servers'
-
-    // hardcode for now
-    var options = {
-        method: 'GET',
-        headers: headers
-    };
-
-
-    if (context && context.queryString) {
-        options.qs = context.queryString
-    }
-
-    console.log('Options are : '+ JSON.stringify(options))
-
-    return new Promise(function(resolve, reject) {
-        request(url, options, function(error, res, body) {
-
-            if (error) {
-                reject(error)
-            }
-
-            var j = JSON.parse(body)
-
-            if (context) {
-                j.context = context
-            }
-
-            // set this for downstream actions that want compute endpoint
-            j.apiEndpoint = apiEndpoint
-            j.apiToken = apiToken
-
-            if (j.servers.length > 0) {
-                j.serverId = j.servers[0].id
-            }
-
-            console.log(j)
-            resolve(j)
-        });
-    });
-
-}
diff --git a/tests/usecases/openstack/deployment.properties b/tests/usecases/openstack/deployment.properties
deleted file mode 100644
index 41c338b..0000000
--- a/tests/usecases/openstack/deployment.properties
+++ /dev/null
@@ -1,15 +0,0 @@
-JiraBackupSolutionactions.getApiToken.host = ibmaic-myhost.com
-JiraBackupSolution.actions.getApiToken.port = 5000
-JiraBackupSolution.actions.getApiToken.endpointName = nova 
-JiraBackupSolution.actions.getApiToken.userId = YYYYY
-JiraBackupSolution.actions.getApiToken.password = XXXXX
-JiraBackupSolution.actions.getApiToken.projectId = YYYYYY
-JiraBackupSolution.actions.callSlack.url = https://hooks.slack.com/services/XXXXX
-JiraBackupSolution.actions.callSlack.channel = YYYY
-JiraBackupSolution.actions.callSlack.username = XXXX
-JiraBackupSolution.triggers.backupTrigger_APP.cron = 0 4 * * *
-JiraBackupSolution.triggers.backupTrigger_APP.triggerPayload = {"backupName":"AIPLTULJAPP001", "backupType":"daily backup", "rotation":7, "queryString":{"name":"AIPLTULJAPP001.aic-platform.com"}}}
-JiraBackupSolution.triggers.backupTrigger_DB.cron = 5 4 * * *
-JiraBackupSolution.triggers.backupTrigger_DB.triggerPayload = {"backupName":"AIPLTULJDB001", "backupType":"daily backup", "rotation":7, "queryString":{"name":"AIPLTULDB001.aic-platform.com"}}}
-JiraBackupSolution.triggers.backupTrigger_WEB.cron = 10 4 * * *
-JiraBackupSolution.triggers.backupTrigger_WEB.triggerPayload = {"backupName":"AIPLTULJWEB001", "backupType":"daily backup", "rotation":7, "queryString":{"name":"AIPLTULJWEB001.aic-platform.com"}}}
diff --git a/tests/usecases/openstack/deployment.yaml b/tests/usecases/openstack/deployment.yaml
deleted file mode 100644
index 52d3400..0000000
--- a/tests/usecases/openstack/deployment.yaml
+++ /dev/null
@@ -1,36 +0,0 @@
-application:
-  name: GBSBackups
-  version: 0.0.1
-  namespace: _
-  packages:
-    JiraBackupSolution:
-      actions:
-        getApiToken:
-          inputs:
-            host: ibmaic-myhost.com
-            port: 5000
-            endpointName: nova
-            userId: YYYYYY
-            password: XXXXXX
-            projectId: YYYYYYY
-        callSlack:
-          inputs:
-            url: https://hooks.slack.com/services/XXXXX
-            channel: XXXXXX
-            username: YYYYYYYY
-      triggers:
-        backupTrigger_APP:
-          inputs: 
-            cron: 0 4 * * * 
-            trigger_payload: '{"context":{"backupName":"AIPLTULJAPP001", "backupType":"daily backup", "rotation":7, "queryString":{"name":"AIPLTULJAPP001.aic-platform.com"}}}'
-        backupTrigger_DB:
-          inputs:
-            cron: 0 5 * * *
-            trigger_payload: '{"context":{"backupName":"AIPLTULJDB001", "backupType":"daily backup", "rotation":7, "queryString":{"name":"AIPLTULDB001.aic-platform.com"}}}'
-        backupTrigger_WEB:
-          inputs:
-            cron: 0 10 * * *
-            trigger_payload: '{"context":{"backupName":"AIPLTULJWEB001", "backupType":"daily backup", "rotation":7, "queryString":{"name":"AIPLTULJWEB001.aic-platform.com"}}}'
-
-
-
diff --git a/tests/usecases/openstack/manifest.yaml b/tests/usecases/openstack/manifest.yaml
deleted file mode 100644
index 04a3fa8..0000000
--- a/tests/usecases/openstack/manifest.yaml
+++ /dev/null
@@ -1,36 +0,0 @@
-package:
-  name: JiraBackupSolution
-  version: 0.0.1
-  license: Apache-2.0
-  actions:
-    getApiToken:
-      function: actions/getApiToken.js
-    getServers:
-      function: actions/getServers.js
-    createBackup:
-      function: actions/createBackup.js
-    callSlack:
-      function: actions/callSlack.js
-  sequences:
-      authorizedBackup:
-        actions: getApiToken, getServers, createBackup, callSlack
-        annotations:
-          web-export:
-          type: string
-  triggers:
-    backupTrigger_APP:
-      source: /whisk.system/alarms/alarm
-    backupTrigger_DB:
-      source: /whisk.system/alarms/alarm
-    backupTrigger_WEB:
-      source: /whisk.system/alarms/alarm
-  rules:
-    backupRule_APP:
-      trigger: backupTrigger_APP
-      action: authorizedBackup
-    backupRule_DB:
-      trigger: backupTrigger_DB
-      action: authorizedBackup
-    backupRule_WEB:
-      trigger: backupTrigger_WEB
-      action: authorizedBackup
diff --git a/tests/usecases/opentest/manifest.yaml b/tests/usecases/opentest/manifest.yaml
deleted file mode 100644
index 3752fa2..0000000
--- a/tests/usecases/opentest/manifest.yaml
+++ /dev/null
@@ -1,8 +0,0 @@
-package:
-  name: opentest
-  triggers:
-    alarmTrigger:
-      source: /whisk.system/alarms/alarm
-      inputs:
-        cron: 0/30 * * * * *
-        trigger_payload: '{"message":"Hello Friend"}'
\ No newline at end of file
diff --git a/tests/usecases/triggerrule/README.md b/tests/usecases/triggerrule/README.md
index 4fde518..17e47ff 100644
--- a/tests/usecases/triggerrule/README.md
+++ b/tests/usecases/triggerrule/README.md
@@ -2,18 +2,21 @@
 
 ### Package description
 
-This Package named "helloworld" includes:
+This Package named `triggerrule` includes:
 - An action named "greeting". It accepts two parameters "name" and "place" and will return a greeting message "Hello, name from place!"
 - A trigger named as "locationUpdate"
 - A rule named "myRule" to associate the trigger with the action.
 
 ### How to deploy and test
 
-Step 1. Deploy the package.
+#### Step 1. Deploy the package.
+
 ```
-$ wskdeploy -m tests/usecases/triggerrule/manifest.yml
+$ wskdeploy -p tests/usecases/triggerrule
 ```
-Step 2. Verify the action is installed.
+
+#### Step 2. Verify the action is installed.
+
 ```
 $ wsk action list
 
@@ -25,27 +28,29 @@ $ wsk action list
     "value": "nodejs:6"
   }],
   "version": "0.0.1",
-  "namespace": "<namespace>/helloworld"
+  "namespace": "<namespace>/triggerrule"
 }
 ```
 
-Step 3. Verify the action's last activation (ID) before invoking.
+#### Step 3. Verify the action's last activation (ID) before invoking.
+
 ```
 $ wsk activation list --limit 1 greeting
 
 activations
 3b80ec50d934464faedc04bc991f8673 greeting
-
 ```
 
-Step 4. Invoke the trigger
-``
+#### Step 4. Invoke the trigger
+
+```
 $ wsk trigger fire locationUpdate --param name Bernie --param place "Washington, D.C."
 
 ok: triggered /_/locationUpdate with id 5f8f26928c384afd85f47281bf85b302
 ```
 
-Step 5. Verify the action is invoked
+#### Step 5. Verify the action is invoked
+
 ```
 $ wsk activation list --limit 2 greeting
 
@@ -54,4 +59,4 @@ a2b5cb1076b24c1885c018bb46f4e990 greeting
 3b80ec50d934464faedc04bc991f8673 greeting
 ```
 
-Indeed an new activation was listed.
+Indeed a new activation was listed.
diff --git a/tests/usecases/triggerrule/deployment.yml b/tests/usecases/triggerrule/deployment.yml
index 1541b3f..f3c0a93 100644
--- a/tests/usecases/triggerrule/deployment.yml
+++ b/tests/usecases/triggerrule/deployment.yml
@@ -1,10 +1,8 @@
 application:
-  name: wskdeploy-samples
+  name: AppWithTriggerRule
 
   packages:
     triggerrule:
-      name: helloworld
-      namespace: guest
       actions:
         greeting:
           inputs:

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