You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@openwhisk.apache.org by gi...@git.apache.org on 2017/10/02 23:11:51 UTC

[GitHub] markusthoemmes commented on a change in pull request #2760: Add new design docs that remove older views that are no longer necessary

markusthoemmes commented on a change in pull request #2760: Add new design docs that remove older views that are no longer necessary
URL: https://github.com/apache/incubator-openwhisk/pull/2760#discussion_r142278523
 
 

 ##########
 File path: tests/src/test/scala/whisk/core/controller/test/ActivationsApiTests.scala
 ##########
 @@ -292,27 +306,56 @@ class ActivationsApiTests extends ControllerTestCommon with WhiskActivationsApi
         end = Instant.now)
     }.toList
     activations foreach { put(activationStore, _) }
-    waitOnView(activationStore, namespace.root, 2, WhiskActivation.collectionName)
+
+    val activationsInPackage = (1 to 2).map { i =>
+      WhiskActivation(
+        namespace,
+        EntityName(s"xyz"),
+        creds.subject,
+        ActivationId(),
+        start = Instant.now,
+        end = Instant.now,
+        annotations = Parameters("path", s"${namespace.asString}/pkg/xyz"))
+    }.toList
+    activationsInPackage foreach { put(activationStore, _) }
+
+    waitOnView(activationStore, namespace.root, 4, WhiskActivation.view)
 
     whisk.utils.retry {
       Get(s"$collectionPath?name=xyz") ~> Route.seal(routes(creds)) ~> check {
         status should be(OK)
         val response = responseAs[List[JsObject]]
-        activations.length should be(response.length)
-        activations forall { a =>
+        val allActivations = activations ++ activationsInPackage
+        allActivations.length should be(response.length)
+        allActivations forall { a =>
           response contains a.summaryAsJson
         } should be(true)
 
 Review comment:
   A check like this will result in `false was not true` which usually doesn't help much.
   
   Would
   
   ```scala
   response should contain theSameElementsAs allActivations.map(_.summaryAsJson)
   ```
   
   work? (I think that might apply to lots of tests here, so it'd be okay not to do this on this PR)
 
----------------------------------------------------------------
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