Skip to content

Commit

Permalink
WIP: remove base64 encoding (#31)
Browse files Browse the repository at this point in the history
* remove base64 encoding

* remove buffer and tostring

* update with properties.yml
  • Loading branch information
bvennam authored and dubee committed Aug 14, 2018
1 parent 8f904e1 commit 9bc8fcd
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
4 changes: 2 additions & 2 deletions packages/actions/deployWeb.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)));
Expand Down Expand Up @@ -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,
};
}

Expand Down
11 changes: 6 additions & 5 deletions tests/src/test/scala/packages/deployWebTests.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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)
}
}
1 change: 1 addition & 0 deletions tools/travis/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 9bc8fcd

Please sign in to comment.