markusthoemmes commented on a change in pull request #3788: Store and pass
variant data in AuthKey
URL:
https://github.com/apache/incubator-openwhisk/pull/3788#discussion_r197824106
##########
File path:
tests/src/test/scala/whisk/core/containerpool/test/ContainerProxyTests.scala
##########
@@ -761,10 +761,13 @@ class ContainerProxyTests
override def run(parameters: JsObject, environment: JsObject, timeout:
FiniteDuration)(
implicit transid: TransactionId): Future[(Interval, ActivationResponse)]
= {
runCount += 1
- environment.fields("api_key") shouldBe message.user.authkey.toJson
+ environment.fields("api_key") shouldBe
message.user.authkey.toEnvironment.fields("api_key")
environment.fields("namespace") shouldBe invocationNamespace.name.toJson
environment.fields("action_name") shouldBe
message.action.qualifiedNameWithLeadingSlash.toJson
environment.fields("activation_id") shouldBe message.activationId.toJson
+ message.user.authkey.toEnvironment.fields.keySet
+ .filter(environment.fields.contains(_))
+ .size shouldBe message.user.authkey.toEnvironment.fields.size
Review comment:
This test can be narrowed down a lot, like:
```scala
val authEnvironment =
environment.fields.filterKeys(message.user.authkey.toEnvironment.fields.contains)
message.user.authkey.toEnvironment shouldBe authEnvironment
```
Will also compare the values and you can drop the explicit api_key check
above.
----------------------------------------------------------------
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