markusthoemmes commented on a change in pull request #2592: Make the result of
response consistent for both Wsk CLI and REST
URL:
https://github.com/apache/incubator-openwhisk/pull/2592#discussion_r133751452
##########
File path: tests/src/test/scala/common/WskTestHelpers.scala
##########
@@ -31,6 +31,55 @@ import spray.json._
import java.time.Instant
/**
+ * An arbitrary response of a whisk action. Includes the result as a JsObject
as the
+ * structure of "result" is not defined.
+ */
+case class ActivationResponse(result: Option[JsObject], status: String,
success: Boolean)
+
+object ActivationResponse extends DefaultJsonProtocol {
+ implicit val serdes = jsonFormat3(ActivationResponse.apply)
+}
+
+/**
+ * Activation record as it is returned by the CLI.
+ */
+ case class ActivationResult (
+ activationId: String,
+ logs: Option[List[String]],
+ response: ActivationResponse,
+ start: Instant,
+ end: Option[Instant], // This field is optional in responses of REST
calls.
+ duration: Option[Long], // This field is optional in responses of REST
calls.
Review comment:
Could we not make those optional but have them deserialize to default
values? I think if `end` is ommitted, the Rest API would give it an
`Instant.EPOCH` while the CLI omits it. Duration I think is always `0` if
ommitted.
----------------------------------------------------------------
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:
[email protected]
With regards,
Apache Git Services