This is an automated email from the ASF dual-hosted git repository.

chetanm 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 68497a1  Restore default runtimes after YARN tests finish (#4313)
68497a1 is described below

commit 68497a11a3f6dc60bb7118156211748567ed05f1
Author: James Dubee <jwdu...@us.ibm.com>
AuthorDate: Wed Feb 27 23:29:55 2019 -0500

    Restore default runtimes after YARN tests finish (#4313)
---
 .../yarn/test/YARNContainerFactoryTests.scala      | 26 +++++++++++++++++-----
 1 file changed, 20 insertions(+), 6 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 e46394f..66b6916 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
@@ -25,20 +25,26 @@ import org.apache.openwhisk.core.WhiskConfig._
 import org.apache.openwhisk.core.containerpool.ContainerArgsConfig
 import org.apache.openwhisk.core.entity.ExecManifest.ImageName
 import org.apache.openwhisk.core.entity.{ByteSize, ExecManifest, 
InvokerInstanceId, SizeUnits}
-import org.apache.openwhisk.core.entity.test.ExecHelpers
 import org.apache.openwhisk.core.yarn.{YARNConfig, YARNContainerFactory, 
YARNRESTUtil, YARNTask}
 import org.junit.runner.RunWith
 import org.scalatest.junit.JUnitRunner
-import org.scalatest.{BeforeAndAfter, FlatSpecLike, Suite}
+import org.scalatest.{BeforeAndAfter, BeforeAndAfterAll, FlatSpecLike, Suite}
+import org.apache.openwhisk.core.entity.test.ExecHelpers
 
 import scala.collection.immutable.Map
 import scala.concurrent.Await
 import scala.concurrent.duration._
 
 @RunWith(classOf[JUnitRunner])
-class YARNContainerFactoryTests extends Suite with BeforeAndAfter with 
FlatSpecLike with ExecHelpers {
+class YARNContainerFactoryTests
+    extends Suite
+    with BeforeAndAfter
+    with FlatSpecLike
+    with ExecHelpers
+    with BeforeAndAfterAll {
 
-  implicit val whiskConfig: WhiskConfig = new WhiskConfig(Map(wskApiHostname 
-> "apihost") ++ wskApiHost)
+  implicit val whiskConfig: WhiskConfig = new WhiskConfig(
+    ExecManifest.requiredProperties ++ Map(wskApiHostname -> "apihost") ++ 
wskApiHost)
 
   val customManifest = Some(s"""
                                |{ "runtimes": {
@@ -96,10 +102,18 @@ class YARNContainerFactoryTests extends Suite with 
BeforeAndAfter with FlatSpecL
   val serviceName1 = yarnConfig.serviceName + "-1"
   val properties: Map[String, Set[String]] = Map[String, Set[String]]()
 
-  ExecManifest.initialize(whiskConfig, customManifest)
-
   behavior of "YARNContainerFactory"
 
+  override def beforeAll = {
+    ExecManifest.initialize(whiskConfig, customManifest)
+    super.beforeAll()
+  }
+
+  override def afterAll = {
+    super.afterAll()
+    ExecManifest.initialize(whiskConfig)
+  }
+
   it should "initialize correctly with zero containers" in {
 
     val rm = new MockYARNRM(8088, 1000)

Reply via email to