openwhisk-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From csantan...@apache.org
Subject [incubator-openwhisk-cli] 09/16: WIP Support retrieving status and configuration of feed triggers in CLI (#2893)
Date Wed, 15 Nov 2017 17:34:20 GMT
This is an automated email from the ASF dual-hosted git repository.

csantanapr pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-openwhisk-cli.git

commit 31f4e0e5c57d34e3b038c3e805d69f67885ce436
Author: Adnan Baruni <abaruni@users.noreply.github.com>
AuthorDate: Wed Nov 8 16:01:20 2017 -0600

    WIP Support retrieving status and configuration of feed triggers in CLI (#2893)
    
    * invoke feed action in trigger get command when appropriate to fetch configuration and
status
    
    * account for annotations for non-feed triggers
    
    * scanCode
    
    * remove unused param
    
    * add tests validating correct lifecycle event. update feeds.md with new lifecycle event
    
    * scalafmt
    
    * remove commented block
    
    * combine feed trigger tests into one
---
 .../whisk/core/cli/test/WskBasicUsageTests.scala     | 20 ++++++++++++++++++--
 1 file changed, 18 insertions(+), 2 deletions(-)

diff --git a/tests/src/test/scala/whisk/core/cli/test/WskBasicUsageTests.scala b/tests/src/test/scala/whisk/core/cli/test/WskBasicUsageTests.scala
index abac6c2..feefb30 100644
--- a/tests/src/test/scala/whisk/core/cli/test/WskBasicUsageTests.scala
+++ b/tests/src/test/scala/whisk/core/cli/test/WskBasicUsageTests.scala
@@ -27,10 +27,8 @@ import scala.language.postfixOps
 import scala.concurrent.duration.Duration
 import scala.concurrent.duration.DurationInt
 import scala.util.Random
-
 import org.junit.runner.RunWith
 import org.scalatest.junit.JUnitRunner
-
 import common.TestHelpers
 import common.TestCLIUtils
 import common.TestUtils
@@ -1126,6 +1124,24 @@ class WskBasicUsageTests extends TestHelpers with WskTestHelpers {
     }
   }
 
+  it should "invoke a feed action with the correct lifecyle event when creating, retrieving
and deleting a feed trigger" in withAssetCleaner(
+    wskprops) { (wp, assetHelper) =>
+    val actionName = "echo"
+    val triggerName = "feedTest"
+
+    assetHelper.withCleaner(wsk.action, actionName) { (action, _) =>
+      action.create(actionName, Some(TestUtils.getTestActionFilename("echo.js")))
+    }
+
+    try {
+      wsk.trigger.create(triggerName, feed = Some(actionName)).stdout should include(""""lifecycleEvent":
"CREATE"""")
+
+      wsk.trigger.get(triggerName).stdout should include(""""lifecycleEvent": "READ"""")
+    } finally {
+      wsk.trigger.delete(triggerName).stdout should include(""""lifecycleEvent": "DELETE"""")
+    }
+  }
+
   it should "denote bound trigger parameters for trigger summaries" in withAssetCleaner(wskprops)
{ (wp, assetHelper) =>
     val trgBoundParams = "trgBoundParams"
     val trgParamAnnot = "trgParamAnnot"

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

Mime
View raw message