markusthoemmes commented on a change in pull request #3950: Extend system 
testsuite
URL: 
https://github.com/apache/incubator-openwhisk/pull/3950#discussion_r208860665
 
 

 ##########
 File path: tests/src/test/scala/common/rest/WskRestOperations.scala
 ##########
 @@ -733,13 +738,23 @@ class RestActivationOperations(implicit val actorSystem: 
ActorSystem)
                    fieldFilter: Option[String] = None,
                    last: Option[Boolean] = None,
                    summary: Option[Boolean] = None)(implicit wp: WskProps): 
RestResult = {
-    val rr = activationId match {
+    val actId = activationId match {
+      case Some(id) => activationId
+      case None =>
+        last match {
+          case Some(b) if b == true => {
+            val activations = pollFor(N = 1, entity = None, limit = Some(1))
+            require(activations.size <= 1)
+            if (activations.isEmpty) None else Some(activations.head)
+          }
 
 Review comment:
   The pattern match can match the "true" directly, as in:
   
   ```scala
   last match {
     case Some(true) =>
     ...
   ```

----------------------------------------------------------------
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:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to