You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openwhisk.apache.org by da...@apache.org on 2017/07/12 02:40:27 UTC
[incubator-openwhisk-cli] branch master updated: Revert "Test cases
sync (#81)"
This is an automated email from the ASF dual-hosted git repository.
daisyguo pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-openwhisk-cli.git
The following commit(s) were added to refs/heads/master by this push:
new 997276d Revert "Test cases sync (#81)"
997276d is described below
commit 997276df6df58e9464aaf961655cba90e994015a
Author: Vincent Hou <sh...@us.ibm.com>
AuthorDate: Tue Jul 11 22:22:29 2017 -0400
Revert "Test cases sync (#81)"
This reverts commit 193c3c5731439eb0f1f03d56ee79f5b3a1e3734b.
---
Godeps/Godeps.json | 2 +-
tests/dat/actions/corsHeaderMod.js | 5 +-
.../apigw/endpoints.without.action.swagger.json | 76 ----------------------
.../scala/whisk/core/cli/test/ApiGwTests.scala | 37 +----------
.../whisk/core/cli/test/WskWebActionsTests.scala | 46 ++++---------
wski18n/i18n_resources.go | 23 ++++---
6 files changed, 25 insertions(+), 164 deletions(-)
diff --git a/Godeps/Godeps.json b/Godeps/Godeps.json
index 23af91a..8c53ce4 100644
--- a/Godeps/Godeps.json
+++ b/Godeps/Godeps.json
@@ -65,7 +65,7 @@
},
{
"ImportPath": "github.com/apache/incubator-openwhisk-client-go/...",
- "Rev": "c997fa3bc91903113eeee087a13f2a0b27fe1f6a"
+ "Rev": "a75fb9114e60a10b42dcc351ffba280fc989caa6"
}
]
}
diff --git a/tests/dat/actions/corsHeaderMod.js b/tests/dat/actions/corsHeaderMod.js
index a658160..b85b4a1 100644
--- a/tests/dat/actions/corsHeaderMod.js
+++ b/tests/dat/actions/corsHeaderMod.js
@@ -2,10 +2,7 @@ function main() {
return {
headers: {
"Access-Control-Allow-Origin": "Origin set from Web Action",
- "Access-Control-Allow-Headers": "Headers set from Web Action",
- "Access-Control-Allow-Methods": "Methods set from Web Action",
- "Location": "openwhisk.org",
- "Set-Cookie": "cookie-cookie-cookie"
+ "Access-Control-Allow-Headers": "Headers set from Web Action"
},
code: 200
}
diff --git a/tests/dat/apigw/endpoints.without.action.swagger.json b/tests/dat/apigw/endpoints.without.action.swagger.json
deleted file mode 100644
index 2305643..0000000
--- a/tests/dat/apigw/endpoints.without.action.swagger.json
+++ /dev/null
@@ -1,76 +0,0 @@
-{
- "swagger": "2.0",
- "basePath": "/NoActions",
- "info": {
- "title": "A descriptive name",
- "version": "1.0"
- },
- "paths": {
- "/": {
- "delete": {
- "operationId": "",
- "responses": {
- "200": {
- "description": "A successful invocation response"
- }
- }
- },
- "get": {
- "operationId": "",
- "responses": {
- "200": {
- "description": "A successful invocation response"
- }
- }
- },
- "head": {
- "operationId": "",
- "responses": {
- "200": {
- "description": "A successful invocation response"
- }
- }
- },
- "options": {
- "operationId": "",
- "responses": {
- "200": {
- "description": "A successful invocation response"
- }
- }
- },
- "patch": {
- "operationId": "",
- "responses": {
- "200": {
- "description": "A successful invocation response"
- }
- }
- },
- "post": {
- "operationId": "",
- "responses": {
- "200": {
- "description": "A successful invocation response"
- }
- }
- },
- "put": {
- "operationId": "",
- "responses": {
- "200": {
- "description": "A successful invocation response"
- }
- }
- }
- }
- },
- "x-ibm-configuration": {
- "assembly": {
- "execute": []
- },
- "cors": {
- "enabled": true
- }
- }
-}
diff --git a/tests/src/test/scala/whisk/core/cli/test/ApiGwTests.scala b/tests/src/test/scala/whisk/core/cli/test/ApiGwTests.scala
index 2a0a1d5..3cb00de 100644
--- a/tests/src/test/scala/whisk/core/cli/test/ApiGwTests.scala
+++ b/tests/src/test/scala/whisk/core/cli/test/ApiGwTests.scala
@@ -640,7 +640,7 @@ class ApiGwTests
it should "verify successful creation and deletion of a new API" in {
val testName = "CLI_APIGWTEST1"
val testbasepath = "/"+testName+"_bp"
- val testrelpath = "/path/with/sub_paths/in/it"
+ val testrelpath = "/path"
val testnewrelpath = "/path_new"
val testurlop = "get"
val testapiname = testName+" API Name"
@@ -658,8 +658,6 @@ class ApiGwTests
rr.stdout should include("ok: APIs")
rr.stdout should include regex (s"/${clinamespace}/${actionName}\\s+${testurlop}\\s+${testapiname}\\s+")
rr.stdout should include(testbasepath + testrelpath)
- rr = apiGet(basepathOrApiName = Some(testbasepath))
- rr.stdout should include regex (s""""operationId":\\s+"getPathWithSub_pathsInIt"""")
val deleteresult = apiDelete(basepathOrApiName = testbasepath)
deleteresult.stdout should include("ok: deleted API")
}
@@ -1212,37 +1210,4 @@ class ApiGwTests
var rr = apiDelete(basepathOrApiName = nonexistentApi, expectedExitCode = ANY_ERROR_EXIT)
rr.stderr should include (s"API '${nonexistentApi}' does not exist")
}
-
- it should "successfully list an API whose endpoints are not mapped to actions" in {
- val testName = "CLI_APIGWTEST23"
- var testapiname = "A descriptive name"
- val testbasepath = "/NoActions"
- val testrelpath = "/"
- val testops: Seq[String] = Seq("put", "delete", "get", "head", "options", "patch", "post")
- val swaggerPath = TestCLIUtils.getTestApiGwFilename(s"endpoints.without.action.swagger.json")
-
- try {
- var rr = apiCreate(swagger = Some(swaggerPath))
- println("api create stdout: " + rr.stdout)
- println("api create stderror: " + rr.stderr)
- rr.stdout should include("ok: created API")
-
- rr = apiList(basepathOrApiName = Some(testbasepath))
- println("api list:\n" + rr.stdout)
- testops foreach { testurlop =>
- rr.stdout should include regex (s"\\s+${testurlop}\\s+${testapiname}\\s+")
- }
- rr.stdout should include(testbasepath + testrelpath)
-
- rr = apiList(basepathOrApiName = Some(testbasepath), full = Some(true))
- println("api full list:\n" + rr.stdout)
- testops foreach { testurlop =>
- rr.stdout should include regex (s"Verb:\\s+${testurlop}")
- }
- rr.stdout should include(testbasepath + testrelpath)
-
- } finally {
- val deleteresult = apiDelete(basepathOrApiName = testbasepath, expectedExitCode = DONTCARE_EXIT)
- }
- }
}
diff --git a/tests/src/test/scala/whisk/core/cli/test/WskWebActionsTests.scala b/tests/src/test/scala/whisk/core/cli/test/WskWebActionsTests.scala
index 1f38acd..c8a4883 100644
--- a/tests/src/test/scala/whisk/core/cli/test/WskWebActionsTests.scala
+++ b/tests/src/test/scala/whisk/core/cli/test/WskWebActionsTests.scala
@@ -89,7 +89,8 @@ class WskWebActionsTestsV2 extends WskWebActionsTests with BeforeAndAfterAll {
val file = Some(TestCLIUtils.getTestActionFilename("echo.js"))
assetHelper.withCleaner(wsk.action, actionName) {
- (action, _) => action.create(actionName, file, web = Some(true.toString))(wp)
+ (action, _) =>
+ action.create(actionName, file, web = Some(true.toString))(wp)
}
val url = getServiceApiHost(vanitySubdomain, true) + s"/default/$actionName.text/a?a=A"
@@ -147,7 +148,8 @@ trait WskWebActionsTests
val file = Some(TestCLIUtils.getTestActionFilename("echo.js"))
assetHelper.withCleaner(wsk.action, name) {
- (action, _) => action.create(name, file, web = Some("true"))
+ (action, _) =>
+ action.create(name, file, web = Some("true"))
}
val host = getServiceURL()
@@ -213,47 +215,19 @@ trait WskWebActionsTests
(wp, assetHelper) =>
val name = "webaction"
val file = Some(TestCLIUtils.getTestActionFilename("corsHeaderMod.js"))
- val host = getServiceURL()
- val url = host + s"$testRoutePath/$namespace/default/webaction.http"
assetHelper.withCleaner(wsk.action, name) {
(action, _) =>
action.create(name, file, web = Some("true"), annotations = Map("web-custom-options" -> true.toJson))
}
- val response = RestAssured.given().config(sslconfig).options(url)
+ val host = getServiceURL()
+ val url = host + s"$testRoutePath/$namespace/default/webaction.http"
+ val response = RestAssured.given().config(sslconfig).options(url)
response.statusCode shouldBe 200
response.header("Access-Control-Allow-Origin") shouldBe "Origin set from Web Action"
- response.header("Access-Control-Allow-Methods") shouldBe "Methods set from Web Action"
response.header("Access-Control-Allow-Headers") shouldBe "Headers set from Web Action"
- response.header("Location") shouldBe "openwhisk.org"
- response.header("Set-Cookie") shouldBe "cookie-cookie-cookie"
- }
-
- it should "ensure that default CORS header is preserved" in withAssetCleaner(wskprops) {
- (wp, assetHelper) =>
- val name = "webaction"
- val file = Some(TestCLIUtils.getTestActionFilename("corsHeaderMod.js"))
- val host = getServiceURL()
- val url = host + s"$testRoutePath/$namespace/default/webaction"
-
- assetHelper.withCleaner(wsk.action, name) {
- (action, _) => action.create(name, file, web = Some("true"))
- }
-
- val responses = Seq(
- RestAssured.given().config(sslconfig).options(s"$url.http"),
- RestAssured.given().config(sslconfig).get(s"$url.json"))
-
- responses.foreach { response =>
- response.statusCode shouldBe 200
- response.header("Access-Control-Allow-Origin") shouldBe "*"
- response.header("Access-Control-Allow-Methods") shouldBe "OPTIONS, GET, DELETE, POST, PUT, HEAD, PATCH"
- response.header("Access-Control-Allow-Headers") shouldBe "Authorization, Content-Type"
- response.header("Location") shouldBe null
- response.header("Set-Cookie") shouldBe null
- }
}
it should "invoke web action to ensure the returned body argument is correct" in withAssetCleaner(wskprops) {
@@ -263,7 +237,8 @@ trait WskWebActionsTests
val bodyContent = "This is the body"
assetHelper.withCleaner(wsk.action, name) {
- (action, _) => action.create(name, file, web = Some("true"))
+ (action, _) =>
+ action.create(name, file, web = Some("true"))
}
val host = getServiceURL()
@@ -288,7 +263,8 @@ trait WskWebActionsTests
val file = Some(TestCLIUtils.getTestActionFilename("textBody.js"))
assetHelper.withCleaner(wsk.action, name) {
- (action, _) => action.create(name, file, web = Some("true"))
+ (action, _) =>
+ action.create(name, file, web = Some("true"))
}
val host = getServiceURL()
diff --git a/wski18n/i18n_resources.go b/wski18n/i18n_resources.go
index 39ebbc8..eda4f46 100644
--- a/wski18n/i18n_resources.go
+++ b/wski18n/i18n_resources.go
@@ -109,12 +109,12 @@ func wski18nResourcesDe_deAllJson() (*asset, error) {
return nil, err
}
- info := bindataFileInfo{name: "wski18n/resources/de_DE.all.json", size: 0, mode: os.FileMode(420), modTime: time.Unix(1499746842, 0)}
+ info := bindataFileInfo{name: "wski18n/resources/de_DE.all.json", size: 0, mode: os.FileMode(420), modTime: time.Unix(1498102835, 0)}
a := &asset{bytes: bytes, info: info}
return a, nil
}
-var _wski18nResourcesEn_usAllJson = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xcc\x5d\x5f\x73\xdb\x38\x92\x7f\x9f\x4f\xd1\x95\x17\x3b\x55\xb2\xb3\xfb\x74\x75\x99\x9a\x07\x4d\xec\xd9\x78\x93\xd8\xae\xc8\x99\xdd\xa9\x9b\xab\x11\x4c\x42\x12\xc6\x14\xc0\x01\x40\x2b\x4a\xd6\xdf\xfd\x0a\x00\x49\x91\x12\xfe\x92\x72\x72\x4f\x71\xc4\xee\x5f\x37\xfe\x37\x1a\xdd\xc0\xff\xfc\x00\xf0\xf5\x07\x00\x80\x17\x24\x7f\xf1\x1a\x5e\x4c\xcb\xb2\x20\x19\x92\x84\x51\xc0\x9f\x89\xc4\x39\x54\x14\x7f\x2e\x71 [...]
+var _wski18nResourcesEn_usAllJson = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xcc\x5d\x5f\x73\xdb\x38\x92\x7f\x9f\x4f\xd1\x95\x17\x3b\x55\xb2\xb3\xfb\x74\x75\x99\x9a\x07\x4d\xec\xd9\x78\x93\xd8\xae\xc8\x99\xdd\xa9\x9b\xab\x11\x4c\x42\x12\xc6\x14\xc0\x01\x40\x2b\x4a\xd6\xdf\xfd\x0a\x00\x49\x91\x12\xfe\x92\x72\x72\x4f\x71\xc4\xee\x5f\x37\xfe\x37\x1a\xdd\xc0\xff\xfc\x00\xf0\xf5\x07\x00\x80\x17\x24\x7f\xf1\x1a\x5e\x4c\xcb\xb2\x20\x19\x92\x84\x51\xc0\x9f\x89\xc4\x39\x54\x14\x7f\x2e\x71 [...]
func wski18nResourcesEn_usAllJsonBytes() ([]byte, error) {
return bindataRead(
@@ -129,7 +129,7 @@ func wski18nResourcesEn_usAllJson() (*asset, error) {
return nil, err
}
- info := bindataFileInfo{name: "wski18n/resources/en_US.all.json", size: 48413, mode: os.FileMode(420), modTime: time.Unix(1499746842, 0)}
+ info := bindataFileInfo{name: "wski18n/resources/en_US.all.json", size: 48166, mode: os.FileMode(420), modTime: time.Unix(1498103751, 0)}
a := &asset{bytes: bytes, info: info}
return a, nil
}
@@ -149,7 +149,7 @@ func wski18nResourcesEs_esAllJson() (*asset, error) {
return nil, err
}
- info := bindataFileInfo{name: "wski18n/resources/es_ES.all.json", size: 0, mode: os.FileMode(420), modTime: time.Unix(1499746842, 0)}
+ info := bindataFileInfo{name: "wski18n/resources/es_ES.all.json", size: 0, mode: os.FileMode(420), modTime: time.Unix(1498102835, 0)}
a := &asset{bytes: bytes, info: info}
return a, nil
}
@@ -169,7 +169,7 @@ func wski18nResourcesFr_frAllJson() (*asset, error) {
return nil, err
}
- info := bindataFileInfo{name: "wski18n/resources/fr_FR.all.json", size: 101, mode: os.FileMode(420), modTime: time.Unix(1499746842, 0)}
+ info := bindataFileInfo{name: "wski18n/resources/fr_FR.all.json", size: 101, mode: os.FileMode(420), modTime: time.Unix(1498102835, 0)}
a := &asset{bytes: bytes, info: info}
return a, nil
}
@@ -189,7 +189,7 @@ func wski18nResourcesIt_itAllJson() (*asset, error) {
return nil, err
}
- info := bindataFileInfo{name: "wski18n/resources/it_IT.all.json", size: 0, mode: os.FileMode(420), modTime: time.Unix(1499746842, 0)}
+ info := bindataFileInfo{name: "wski18n/resources/it_IT.all.json", size: 0, mode: os.FileMode(420), modTime: time.Unix(1498102835, 0)}
a := &asset{bytes: bytes, info: info}
return a, nil
}
@@ -209,7 +209,7 @@ func wski18nResourcesJa_jaAllJson() (*asset, error) {
return nil, err
}
- info := bindataFileInfo{name: "wski18n/resources/ja_JA.all.json", size: 0, mode: os.FileMode(420), modTime: time.Unix(1499746842, 0)}
+ info := bindataFileInfo{name: "wski18n/resources/ja_JA.all.json", size: 0, mode: os.FileMode(420), modTime: time.Unix(1498102835, 0)}
a := &asset{bytes: bytes, info: info}
return a, nil
}
@@ -229,7 +229,7 @@ func wski18nResourcesKo_krAllJson() (*asset, error) {
return nil, err
}
- info := bindataFileInfo{name: "wski18n/resources/ko_KR.all.json", size: 0, mode: os.FileMode(420), modTime: time.Unix(1499746842, 0)}
+ info := bindataFileInfo{name: "wski18n/resources/ko_KR.all.json", size: 0, mode: os.FileMode(420), modTime: time.Unix(1498102835, 0)}
a := &asset{bytes: bytes, info: info}
return a, nil
}
@@ -249,7 +249,7 @@ func wski18nResourcesPt_brAllJson() (*asset, error) {
return nil, err
}
- info := bindataFileInfo{name: "wski18n/resources/pt_BR.all.json", size: 0, mode: os.FileMode(420), modTime: time.Unix(1499746842, 0)}
+ info := bindataFileInfo{name: "wski18n/resources/pt_BR.all.json", size: 0, mode: os.FileMode(420), modTime: time.Unix(1498102835, 0)}
a := &asset{bytes: bytes, info: info}
return a, nil
}
@@ -269,7 +269,7 @@ func wski18nResourcesZh_hansAllJson() (*asset, error) {
return nil, err
}
- info := bindataFileInfo{name: "wski18n/resources/zh_Hans.all.json", size: 0, mode: os.FileMode(420), modTime: time.Unix(1499746842, 0)}
+ info := bindataFileInfo{name: "wski18n/resources/zh_Hans.all.json", size: 0, mode: os.FileMode(420), modTime: time.Unix(1498102835, 0)}
a := &asset{bytes: bytes, info: info}
return a, nil
}
@@ -289,7 +289,7 @@ func wski18nResourcesZh_hantAllJson() (*asset, error) {
return nil, err
}
- info := bindataFileInfo{name: "wski18n/resources/zh_Hant.all.json", size: 0, mode: os.FileMode(420), modTime: time.Unix(1499746842, 0)}
+ info := bindataFileInfo{name: "wski18n/resources/zh_Hant.all.json", size: 0, mode: os.FileMode(420), modTime: time.Unix(1498102835, 0)}
a := &asset{bytes: bytes, info: info}
return a, nil
}
@@ -460,4 +460,3 @@ func _filePath(dir, name string) string {
cannonicalName := strings.Replace(name, "\\", "/", -1)
return filepath.Join(append([]string{dir}, strings.Split(cannonicalName, "/")...)...)
}
-
--
To stop receiving notification emails like this one, please contact
['"commits@openwhisk.apache.org" <co...@openwhisk.apache.org>'].