You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openwhisk.apache.org by du...@apache.org on 2018/08/14 13:23:18 UTC
[incubator-openwhisk-package-deploy] branch master updated: WIP:
remove base64 encoding (#31)
This is an automated email from the ASF dual-hosted git repository.
dubeejw pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-openwhisk-package-deploy.git
The following commit(s) were added to refs/heads/master by this push:
new 9bc8fcd WIP: remove base64 encoding (#31)
9bc8fcd is described below
commit 9bc8fcdd174ff0a8facaa46553ca0aa934d29de5
Author: Belinda Vennam <be...@gmail.com>
AuthorDate: Tue Aug 14 08:23:16 2018 -0500
WIP: remove base64 encoding (#31)
* remove base64 encoding
* remove buffer and tostring
* update with properties.yml
---
packages/actions/deployWeb.js | 4 ++--
tests/src/test/scala/packages/deployWebTests.scala | 11 ++++++-----
tools/travis/build.sh | 1 +
3 files changed, 9 insertions(+), 7 deletions(-)
diff --git a/packages/actions/deployWeb.js b/packages/actions/deployWeb.js
index 282a9ae..a631477 100644
--- a/packages/actions/deployWeb.js
+++ b/packages/actions/deployWeb.js
@@ -75,7 +75,7 @@ function main(params) {
resolve({
statusCode: 200,
headers: { 'Content-Type': 'application/json' },
- body: Buffer.from(JSON.stringify({ status: success, activationId })).toString('base64'),
+ body: { status: success, activationId },
});
}))
.catch(err => (sendError(400, err)));
@@ -120,7 +120,7 @@ function sendError(statusCode, err, message) {
return {
statusCode,
headers: { 'Content-Type': 'application/json' },
- body: Buffer.from(JSON.stringify(params)).toString('base64'),
+ body: params,
};
}
diff --git a/tests/src/test/scala/packages/deployWebTests.scala b/tests/src/test/scala/packages/deployWebTests.scala
index 054aa06..0ffbed2 100644
--- a/tests/src/test/scala/packages/deployWebTests.scala
+++ b/tests/src/test/scala/packages/deployWebTests.scala
@@ -52,9 +52,10 @@ class DeployWebTests extends TestHelpers
val helloWorldActionPackage = "myPackage/helloworld"
// statuses from deployWeb
- val successStatus = """"status":"success""""
+ val successStatus = """"status": "success""""
val activationId = """"activationId:""""
- val githubNonExistentStatus = """"error":"There was a problem cloning from github. Does that github repo exist? Does it begin with http?""""
+ val githubNonExistentStatus = """"error": "There was a problem cloning from github. Does that github repo exist? Does it begin with http?""""
+ val errorLoadingManifestStatus = """"error": "Error loading manifest file. Does a manifest file exist?""""
def makePostCallWithExpectedResult(params: JsObject, expectedResult: String, expectedCode: Int) = {
val response = RestAssured.given()
@@ -107,7 +108,7 @@ class DeployWebTests extends TestHelpers
"manifestPath" -> JsString(helloWorldPath),
"wskApiHost" -> JsString(wskprops.apihost),
"wskAuth" -> JsString(wskprops.authKey)
- ), """"error":"Please enter the GitHub repo url in params"""", 400)
+ ), """"error": "Please enter the GitHub repo url in params"""", 400)
}
// test to create a template with a nonexistant github repo provided
@@ -141,7 +142,7 @@ class DeployWebTests extends TestHelpers
"manifestPath" -> JsString(incorrectManifestPath),
"wskApiHost" -> JsString(wskprops.apihost),
"wskAuth" -> JsString(wskprops.authKey)
- ), """"error":"Error loading manifest file. Does a manifest file exist?"""", 400)
+ ), errorLoadingManifestStatus, 400)
}
// test to create a template with manifestPath provided, but no manifestFile existing
@@ -151,6 +152,6 @@ class DeployWebTests extends TestHelpers
"manifestPath" -> JsString(helloWorldWithNoManifest),
"wskApiHost" -> JsString(wskprops.apihost),
"wskAuth" -> JsString(wskprops.authKey)
- ), """"error":"Error loading manifest file. Does a manifest file exist?"""", 400)
+ ), errorLoadingManifestStatus, 400)
}
}
diff --git a/tools/travis/build.sh b/tools/travis/build.sh
index 65977f8..3b2430f 100755
--- a/tools/travis/build.sh
+++ b/tools/travis/build.sh
@@ -40,6 +40,7 @@ cd $WHISKDIR/ansible
$ANSIBLE_CMD wipe.yml
$ANSIBLE_CMD openwhisk.yml
+$ANSIBLE_CMD properties.yml
# Set Environment
export OPENWHISK_HOME=$WHISKDIR