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 2018/04/24 05:50:40 UTC

[GitHub] markusthoemmes commented on a change in pull request #3568: Add activation result integration test

markusthoemmes commented on a change in pull request #3568: Add activation result integration test
URL: https://github.com/apache/incubator-openwhisk/pull/3568#discussion_r183611254
 
 

 ##########
 File path: tests/src/test/scala/system/basic/WskActivationTests.scala
 ##########
 @@ -54,4 +57,24 @@ abstract class WskActivationTests extends TestHelpers with WskTestHelpers with J
       }, 10, Some(1.second))
     }
   }
+
+  it should "fetch result using activation result API" in withAssetCleaner(wskprops) { (wp, assetHelper) =>
+    val name = "hello"
+    val expectedResult = JsObject("payload" -> "hello, undefined!".toJson)
+
+    assetHelper.withCleaner(wsk.action, name) { (action, _) =>
+      action.create(name, Some(TestUtils.getTestActionFilename("hello.js")))
+    }
+
+    val run = wsk.action.invoke(name, blocking = true)
+
+    // Use withActivation() to reduce intermittent failures that may result from eventually consistent DBs
+    withActivation(wsk.activation, run) { activation =>
+      retry({
+        val result = wsk.activation.result(Some(activation.activationId)).stdout
+
+        result should include(expectedResult.compactPrint)
 
 Review comment:
   Shall we test based on the implementaton of `BaseWsk` then? I dislike the string based matching as well, although it sounds wrong to do it this way 🤔 

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