You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openwhisk.apache.org by du...@apache.org on 2019/02/26 18:54:06 UTC
[incubator-openwhisk] branch master updated: Use custom runtime
manifest for YARN tests (#4307)
This is an automated email from the ASF dual-hosted git repository.
dubeejw pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-openwhisk.git
The following commit(s) were added to refs/heads/master by this push:
new bb9f408 Use custom runtime manifest for YARN tests (#4307)
bb9f408 is described below
commit bb9f40830022d883c1d07dfab23c63dc431870d2
Author: James Dubee <jw...@us.ibm.com>
AuthorDate: Tue Feb 26 13:53:56 2019 -0500
Use custom runtime manifest for YARN tests (#4307)
* Use custom manifest for YARN tests
* Remove imageTag method
---
.../yarn/test/YARNContainerFactoryTests.scala | 42 ++++++++++++++++++----
.../openwhisk/core/entity/test/ExecHelpers.scala | 3 --
2 files changed, 35 insertions(+), 10 deletions(-)
diff --git a/tests/src/test/scala/org/apache/openwhisk/core/containerpool/yarn/test/YARNContainerFactoryTests.scala b/tests/src/test/scala/org/apache/openwhisk/core/containerpool/yarn/test/YARNContainerFactoryTests.scala
index 6619f6a..e46394f 100644
--- a/tests/src/test/scala/org/apache/openwhisk/core/containerpool/yarn/test/YARNContainerFactoryTests.scala
+++ b/tests/src/test/scala/org/apache/openwhisk/core/containerpool/yarn/test/YARNContainerFactoryTests.scala
@@ -37,10 +37,41 @@ import scala.concurrent.duration._
@RunWith(classOf[JUnitRunner])
class YARNContainerFactoryTests extends Suite with BeforeAndAfter with FlatSpecLike with ExecHelpers {
+
+ implicit val whiskConfig: WhiskConfig = new WhiskConfig(Map(wskApiHostname -> "apihost") ++ wskApiHost)
+
+ val customManifest = Some(s"""
+ |{ "runtimes": {
+ | "runtime1": [
+ | {
+ | "kind": "somekind:1",
+ | "deprecated": false,
+ | "default": true,
+ | "image": {
+ | "prefix": "openwhisk",
+ | "name": "somekind",
+ | "tag": "latest"
+ | }
+ | }
+ | ],
+ | "runtime2": [
+ | {
+ | "kind": "anotherkind:1",
+ | "deprecated": false,
+ | "default": true,
+ | "image": {
+ | "prefix": "openwhisk",
+ | "name": "anotherkind",
+ | "tag": "latest"
+ | }
+ | }
+ | ]
+ | }
+ |}
+ |""".stripMargin)
val images = Array(
- ImageName("nodejs6action", Option("openwhisk"), imageTag("nodejs:6")),
- ImageName("python3action", Option("openwhisk"), imageTag("python:3")))
- val runtimes = ExecManifest.runtimesManifest.toJson.compactPrint
+ ImageName("somekind", Option("openwhisk"), Some("latest")),
+ ImageName("anotherkind", Option("openwhisk"), Some("latest")))
val containerArgsConfig =
new ContainerArgsConfig(
"net1",
@@ -65,10 +96,7 @@ class YARNContainerFactoryTests extends Suite with BeforeAndAfter with FlatSpecL
val serviceName1 = yarnConfig.serviceName + "-1"
val properties: Map[String, Set[String]] = Map[String, Set[String]]()
- implicit val whiskConfig: WhiskConfig = new WhiskConfig(
- Map(wskApiHostname -> "apihost", runtimesManifest -> runtimes) ++ wskApiHost)
-
- ExecManifest.initialize(whiskConfig)
+ ExecManifest.initialize(whiskConfig, customManifest)
behavior of "YARNContainerFactory"
diff --git a/tests/src/test/scala/org/apache/openwhisk/core/entity/test/ExecHelpers.scala b/tests/src/test/scala/org/apache/openwhisk/core/entity/test/ExecHelpers.scala
index 91d0003..4a12d30 100644
--- a/tests/src/test/scala/org/apache/openwhisk/core/entity/test/ExecHelpers.scala
+++ b/tests/src/test/scala/org/apache/openwhisk/core/entity/test/ExecHelpers.scala
@@ -45,9 +45,6 @@ trait ExecHelpers extends Matchers with WskActorSystem with StreamLogging {
protected def imageName(name: String) =
ExecManifest.runtimesManifest.runtimes.flatMap(_.versions).find(_.kind == name).get.image
- protected def imageTag(name: String) =
- ExecManifest.runtimesManifest.runtimes.flatMap(_.versions).find(_.kind == name).get.image.tag
-
protected def js10Old(code: String, main: Option[String] = None) = {
CodeExecAsString(
RuntimeManifest(