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 2017/12/01 18:05:24 UTC

[GitHub] jessealva closed pull request #3045: Test updates needed in order to be able to test extra quote strings in the CLI

jessealva closed pull request #3045: Test updates needed in order to be able to test extra quote strings in the CLI
URL: https://github.com/apache/incubator-openwhisk/pull/3045
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/tests/src/test/scala/common/BaseWsk.scala b/tests/src/test/scala/common/BaseWsk.scala
index 0917fa6942..98bdb2e689 100644
--- a/tests/src/test/scala/common/BaseWsk.scala
+++ b/tests/src/test/scala/common/BaseWsk.scala
@@ -284,9 +284,13 @@ trait BaseActivation extends BaseRunWsk {
   def get(activationId: Option[String] = None,
           expectedExitCode: Int = SUCCESS_EXIT,
           fieldFilter: Option[String] = None,
-          last: Option[Boolean] = None)(implicit wp: WskProps): RunResult
+          last: Option[Boolean] = None,
+          summary: Option[Boolean] = None)(implicit wp: WskProps): RunResult
 
-  def console(duration: Duration, since: Option[Duration] = None, expectedExitCode: Int = SUCCESS_EXIT)(
+  def console(duration: Duration,
+              since: Option[Duration] = None,
+              expectedExitCode: Int = SUCCESS_EXIT,
+              actionName: Option[String] = None)(
     implicit wp: WskProps): RunResult
 
   def logs(activationId: Option[String] = None, expectedExitCode: Int = SUCCESS_EXIT, last: Option[Boolean] = None)(
diff --git a/tests/src/test/scala/common/Wsk.scala b/tests/src/test/scala/common/Wsk.scala
index 5a4519282f..5db11fddf4 100644
--- a/tests/src/test/scala/common/Wsk.scala
+++ b/tests/src/test/scala/common/Wsk.scala
@@ -500,9 +500,16 @@ class WskActivation() extends RunWskCmd with HasActivation with WaitFor with Bas
    * @param duration exits console after duration
    * @param since (optional) time travels back to activation since given duration
    */
-  override def console(duration: Duration, since: Option[Duration] = None, expectedExitCode: Int = SUCCESS_EXIT)(
+  override def console(duration: Duration,
+                       since: Option[Duration] = None,
+                       expectedExitCode: Int = SUCCESS_EXIT,
+                       actionName: Option[String] = None)(
     implicit wp: WskProps): RunResult = {
-    val params = Seq(noun, "poll", "--auth", wp.authKey, "--exit", duration.toSeconds.toString) ++ {
+    val params = Seq(noun, "poll") ++ {
+      actionName map { name =>
+        Seq(name)
+      } getOrElse Seq()
+    } ++ Seq("--auth", wp.authKey, "--exit", duration.toSeconds.toString) ++ {
       since map { s =>
         Seq("--since-seconds", s.toSeconds.toString)
       } getOrElse Seq()
@@ -563,7 +570,8 @@ class WskActivation() extends RunWskCmd with HasActivation with WaitFor with Bas
   override def get(activationId: Option[String] = None,
                    expectedExitCode: Int = SUCCESS_EXIT,
                    fieldFilter: Option[String] = None,
-                   last: Option[Boolean] = None)(implicit wp: WskProps): RunResult = {
+                   last: Option[Boolean] = None,
+                   summary: Option[Boolean] = None)(implicit wp: WskProps): RunResult = {
     val params = {
       activationId map { a =>
         Seq(a)
@@ -576,6 +584,10 @@ class WskActivation() extends RunWskCmd with HasActivation with WaitFor with Bas
       last map { l =>
         Seq("--last")
       } getOrElse Seq()
+    } ++ {
+      summary map { s =>
+        Seq("--summary")
+      } getOrElse Seq()
     }
     cli(wp.overrides ++ Seq(noun, "get", "--auth", wp.authKey) ++ params, expectedExitCode)
   }
diff --git a/tests/src/test/scala/common/rest/WskRest.scala b/tests/src/test/scala/common/rest/WskRest.scala
index a38ba16531..197d772777 100644
--- a/tests/src/test/scala/common/rest/WskRest.scala
+++ b/tests/src/test/scala/common/rest/WskRest.scala
@@ -617,7 +617,10 @@ class WskRestActivation extends RunWskRestCmd with HasActivationRest with WaitFo
    * @param duration exits console after duration
    * @param since (optional) time travels back to activation since given duration
    */
-  override def console(duration: Duration, since: Option[Duration] = None, expectedExitCode: Int = SUCCESS_EXIT)(
+  override def console(duration: Duration,
+                       since: Option[Duration] = None,
+                       expectedExitCode: Int = SUCCESS_EXIT,
+                       actionName: Option[String] = None)(
     implicit wp: WskProps): RestResult = {
     require(duration > 1.second, "duration must be at least 1 second")
     val sinceTime = {
@@ -743,7 +746,8 @@ class WskRestActivation extends RunWskRestCmd with HasActivationRest with WaitFo
   override def get(activationId: Option[String],
                    expectedExitCode: Int = OK.intValue,
                    fieldFilter: Option[String] = None,
-                   last: Option[Boolean] = None)(implicit wp: WskProps): RestResult = {
+                   last: Option[Boolean] = None,
+                   summary: Option[Boolean] = None)(implicit wp: WskProps): RestResult = {
     val r = activationId match {
       case Some(id) => {
         val resp = requestEntity(GET, getNamePath(noun, id))


 

----------------------------------------------------------------
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