You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@openwhisk.apache.org by GitBox <gi...@apache.org> on 2018/02/16 13:47:15 UTC
[GitHub] mdeuser commented on a change in pull request #223: Sync tests
mdeuser commented on a change in pull request #223: Sync tests
URL: https://github.com/apache/incubator-openwhisk-cli/pull/223#discussion_r168759622
##########
File path: tests/src/test/scala/system/basic/WskBasicTests.scala
##########
@@ -464,34 +470,67 @@ class WskBasicTests extends TestHelpers with WskTestHelpers {
behavior of "Wsk Trigger CLI"
it should "create, update, get, fire and list trigger" in withAssetCleaner(wskprops) { (wp, assetHelper) =>
- val name = "listTriggers"
+ val ruleName = withTimestamp("r1toa1")
+ val triggerName = withTimestamp("t1tor1")
+ val actionName = withTimestamp("a1")
val params = Map("a" -> "A".toJson)
- assetHelper.withCleaner(wsk.trigger, name) { (trigger, _) =>
- trigger.create(name, parameters = params)
- trigger.create(name, update = true)
+ val ns = wsk.namespace.whois()
+
+ assetHelper.withCleaner(wsk.trigger, triggerName) { (trigger, _) =>
+ trigger.create(triggerName, parameters = params)
+ trigger.create(triggerName, update = true)
+ }
+
+ assetHelper.withCleaner(wsk.action, actionName) { (action, name) =>
+ action.create(name, defaultAction)
+ }
+
+ assetHelper.withCleaner(wsk.rule, ruleName) { (rule, name) =>
+ rule.create(name, trigger = triggerName, action = actionName)
}
- val stdout = wsk.trigger.get(name).stdout
- stdout should include regex (""""key": "a"""")
- stdout should include regex (""""value": "A"""")
- stdout should include regex (""""publish": false""")
- stdout should include regex (""""version": "0.0.2"""")
+
+ val trigger = wsk.trigger.get(triggerName)
+ getJSONFromResponse(trigger.stdout, true).fields("parameters") shouldBe JsArray(JsObject("key" -> JsString("a"), "value" -> JsString("A")))
+ getJSONFromResponse(trigger.stdout, true).fields("publish") shouldBe false.toJson
+ getJSONFromResponse(trigger.stdout, true).fields("version") shouldBe "0.0.2".toJson
+
+ val expectedRules = JsObject(
+ ns + "/" + ruleName -> JsObject(
+ "action" -> JsObject("name" -> JsString(actionName), "path" -> JsString(ns)),
+ "status" -> JsString("active")))
+
+ // getJSONFromResponse(trigger.stdout, true).fields("rules") shouldBe expectedRules
Review comment:
@dubeejw - line 502 can be un-commented; the required backend change has been merged into the openwhisk repo.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services