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

 ##########
 File path: 
tests/src/test/scala/whisk/core/controller/test/ActivationsApiTests.scala
 ##########
 @@ -462,6 +462,58 @@ class ActivationsApiTests extends ControllerTestCommon 
with WhiskActivationsApi
     }
   }
 
+  it should "skip activations and return correct ones" in {
+    implicit val tid = transid()
+    val activations = (1 to 3).map { _ =>
+      WhiskActivation(
+        namespace,
+        aname(),
+        creds.subject,
+        ActivationId.generate(),
+        start = Instant.now,
+        end = Instant.now)
+    }.toList
+
+    try {
+      activations.foreach(storeActivation)
+      waitOnListActivationsInNamespace(namespace, 3)
+
+      Get(s"$collectionPath?skip=1") ~> Route.seal(routes(creds)) ~> check {
+        status should be(OK)
+        val activations = responseAs[List[JsObject]]
+        activations.length should be(2)
+      }
+    } finally {
+      activations.foreach(a => 
deleteActivation(ActivationId(a.docid.asString)))
+    }
+  }
+
+  it should "return last activation" in {
+    implicit val tid = transid()
+    val activations = (1 to 3).map { _ =>
+      WhiskActivation(
+        namespace,
+        aname(),
+        creds.subject,
+        ActivationId.generate(),
+        start = Instant.now,
+        end = Instant.now)
+    }.toList
+
+    try {
+      activations.foreach(storeActivation)
+      waitOnListActivationsInNamespace(namespace, 3)
+
+      Get(s"$collectionPath?limit=1") ~> Route.seal(routes(creds)) ~> check {
+        status should be(OK)
+        val activations = responseAs[List[JsObject]]
+        activations.length should be(1)
+      }
 
 Review comment:
   Same comments as above, we should narrow the check and not hardcode the "3" 
in the waitOn expression.

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