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

 ##########
 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:
   As to making the CLI and REST responses appear the same, this is related to 
the HTTP status code when the action errors which we've not closed.

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