Add exec kind to annotation for an action and show it in action list.
diff --git a/tests/src/whisk/core/cli/test/WskBasicUsageTests.scala b/tests/src/whisk/core/cli/test/WskBasicUsageTests.scala
index 04bd017..f149163 100644
--- a/tests/src/whisk/core/cli/test/WskBasicUsageTests.scala
+++ b/tests/src/whisk/core/cli/test/WskBasicUsageTests.scala
@@ -658,7 +658,7 @@
action.create(name, file)
}
retry({
- wsk.action.list().stdout should include(s"$name private")
+ wsk.action.list().stdout should include(s"$name private nodejs")
}, 5, Some(1 second))
}
diff --git a/tests/src/whisk/core/controller/test/ActionsApiTests.scala b/tests/src/whisk/core/controller/test/ActionsApiTests.scala
index 427ae41..3381ed7 100644
--- a/tests/src/whisk/core/controller/test/ActionsApiTests.scala
+++ b/tests/src/whisk/core/controller/test/ActionsApiTests.scala
@@ -302,7 +302,9 @@
deleteAction(action.docid)
status should be(OK)
val response = responseAs[WhiskAction]
- response should be(action)
+ response should be(WhiskAction(action.namespace, action.name, action.exec,
+ action.parameters, action.limits, action.version,
+ action.publish, action.annotations ++ Parameters(WhiskAction.execFieldName, Exec.NODEJS)))
}
}
@@ -314,7 +316,9 @@
deleteAction(action.docid)
status should be(OK)
val response = responseAs[WhiskAction]
- response should be(action)
+ response should be(WhiskAction(action.namespace, action.name, action.exec,
+ action.parameters, action.limits, action.version,
+ action.publish, action.annotations ++ Parameters(WhiskAction.execFieldName, Exec.BLACKBOX)))
response.exec shouldBe an[BlackBoxExec]
response.exec.asInstanceOf[BlackBoxExec].code shouldBe empty
}
@@ -328,7 +332,9 @@
deleteAction(action.docid)
status should be(OK)
val response = responseAs[WhiskAction]
- response should be(action)
+ response should be(WhiskAction(action.namespace, action.name, action.exec,
+ action.parameters, action.limits, action.version,
+ action.publish, action.annotations ++ Parameters(WhiskAction.execFieldName, Exec.BLACKBOX)))
response.exec shouldBe an[BlackBoxExec]
val bb = response.exec.asInstanceOf[BlackBoxExec]
bb.code shouldBe Some("cc")
@@ -391,7 +397,9 @@
deleteAction(action.docid)
status should be(OK)
val response = responseAs[WhiskAction]
- response should be(action)
+ response should be(WhiskAction(action.namespace, action.name, action.exec,
+ action.parameters, action.limits, action.version,
+ action.publish, action.annotations ++ Parameters(WhiskAction.execFieldName, Exec.NODEJS)))
}
}
@@ -414,7 +422,9 @@
deleteAction(action.docid)
status should be(OK)
val response = responseAs[WhiskAction]
- response should be(action)
+ response should be(WhiskAction(action.namespace, action.name, action.exec,
+ action.parameters, action.limits, action.version,
+ action.publish, action.annotations ++ Parameters(WhiskAction.execFieldName, Exec.NODEJS)))
}
}
@@ -432,7 +442,9 @@
Put(s"$collectionPath/$name", content) ~> sealRoute(routes(creds)(transid())) ~> check {
status should be(OK)
val response = responseAs[WhiskAction]
- response should be(action)
+ response should be(WhiskAction(action.namespace, action.name, action.exec,
+ action.parameters, action.limits, action.version,
+ action.publish, action.annotations ++ Parameters(WhiskAction.execFieldName, Exec.NODEJS)))
}
stream.toString should include regex (s"caching*.*${action.docid.asDocInfo}")
stream.reset()
@@ -441,7 +453,9 @@
Get(s"$collectionPath/$name") ~> sealRoute(routes(creds)(transid())) ~> check {
status should be(OK)
val response = responseAs[WhiskAction]
- response should be(action)
+ response should be(WhiskAction(action.namespace, action.name, action.exec,
+ action.parameters, action.limits, action.version,
+ action.publish, action.annotations ++ Parameters(WhiskAction.execFieldName, Exec.NODEJS)))
}
stream.toString should include regex (s"serving from cache:*.*${action.docid.asDocInfo}")
@@ -451,7 +465,9 @@
Delete(s"$collectionPath/$name") ~> sealRoute(routes(creds)(transid())) ~> check {
status should be(OK)
val response = responseAs[WhiskAction]
- response should be(action)
+ response should be(WhiskAction(action.namespace, action.name, action.exec,
+ action.parameters, action.limits, action.version,
+ action.publish, action.annotations ++ Parameters(WhiskAction.execFieldName, Exec.NODEJS)))
}
stream.toString should include regex (s"invalidating*.*${action.docid.asDocInfo}")
stream.reset()
@@ -482,7 +498,8 @@
status should be(OK)
val response = responseAs[WhiskAction]
response should be {
- WhiskAction(action.namespace, action.name, content.exec.get, content.parameters.get, version = action.version.upPatch)
+ WhiskAction(action.namespace, action.name, content.exec.get, content.parameters.get, version = action.version.upPatch,
+ annotations = action.annotations ++ Parameters(WhiskAction.execFieldName, Exec.NODEJS))
}
}
}
@@ -497,7 +514,8 @@
status should be(OK)
val response = responseAs[WhiskAction]
response should be {
- WhiskAction(action.namespace, action.name, action.exec, content.parameters.get, version = action.version.upPatch)
+ WhiskAction(action.namespace, action.name, action.exec, content.parameters.get, version = action.version.upPatch,
+ annotations = action.annotations ++ Parameters(WhiskAction.execFieldName, Exec.NODEJS))
}
}
}
diff --git a/tests/src/whisk/core/controller/test/PackageActionsApiTests.scala b/tests/src/whisk/core/controller/test/PackageActionsApiTests.scala
index 366776f..103e6f9 100644
--- a/tests/src/whisk/core/controller/test/PackageActionsApiTests.scala
+++ b/tests/src/whisk/core/controller/test/PackageActionsApiTests.scala
@@ -161,7 +161,9 @@
deleteAction(action.docid)
status should be(OK)
val response = responseAs[WhiskAction]
- response should be(action)
+ response should be(WhiskAction(action.namespace, action.name, action.exec,
+ action.parameters, action.limits, action.version,
+ action.publish, action.annotations ++ Parameters(WhiskAction.execFieldName, Exec.NODEJS)))
}
}