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

dgrove 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 50de78a  Bypass system test for runtime kind if test file is not found 
(rather than fail). (#3869)
50de78a is described below

commit 50de78a9d5f723485b0f568901189e2447580a47
Author: rodric rabbah <[email protected]>
AuthorDate: Tue Jul 10 16:23:26 2018 -0400

    Bypass system test for runtime kind if test file is not found (rather than 
fail). (#3869)
---
 .../test/scala/system/basic/WskUnicodeTests.scala  | 53 +++++++++++-----------
 tests/src/test/scala/system/rest/RestUtil.scala    |  7 ++-
 2 files changed, 32 insertions(+), 28 deletions(-)

diff --git a/tests/src/test/scala/system/basic/WskUnicodeTests.scala 
b/tests/src/test/scala/system/basic/WskUnicodeTests.scala
index 1000bc6..611d8ba 100644
--- a/tests/src/test/scala/system/basic/WskUnicodeTests.scala
+++ b/tests/src/test/scala/system/basic/WskUnicodeTests.scala
@@ -64,36 +64,35 @@ class WskUnicodeTests extends TestHelpers with 
WskTestHelpers with JsHelpers wit
     val bin = new File(TestUtils.getTestActionFilename(s"$prefix.bin"))
     if (txt.exists) Some(txt.toString)
     else if (bin.exists) Some(bin.toString)
-    else throw new IllegalStateException(s"did not find text or binary action 
for kind $kind")
+    else {
+      println(s"WARNING: did not find text or binary action for kind $kind, 
skipping it")
+      None
+    }
   }
 
-  actionKinds.foreach { k =>
-    val actionKind = k.kind
-
-    s"$actionKind action" should "Ensure that UTF-8 in supported in source 
files, input params, logs, and output results" in withAssetCleaner(
-      wskprops) { (wp, assetHelper) =>
-      val name = s"unicodeGalore.${actionKind.replace(":", "")}"
-
-      assetHelper.withCleaner(wsk.action, name) { (action, _) =>
-        action.create(
-          name,
-          getFileLocation(actionKind),
-          main = main(actionKind),
-          kind = Some(actionKind),
-          timeout = Some(activationMaxDuration))
+  // tolerate missing files rather than throw an exception
+  actionKinds.map(k => (k.kind, getFileLocation(k.kind))).collect {
+    case (actionKind, file @ Some(_)) =>
+      s"$actionKind action" should "Ensure that UTF-8 in supported in source 
files, input params, logs, and output results" in withAssetCleaner(
+        wskprops) { (wp, assetHelper) =>
+        val name = s"unicodeGalore.${actionKind.replace(":", "")}"
+
+        assetHelper.withCleaner(wsk.action, name) { (action, _) =>
+          action
+            .create(name, file, main = main(actionKind), kind = 
Some(actionKind), timeout = Some(activationMaxDuration))
+        }
+
+        withActivation(
+          wsk.activation,
+          wsk.action.invoke(name, parameters = Map("delimiter" -> 
JsString("❄"))),
+          totalWait = activationPollDuration) { activation =>
+          val response = activation.response
+          response.result.get.fields.get("error") shouldBe empty
+          response.result.get.fields.get("winter") should be(Some(JsString("❄ 
☃ ❄")))
+
+          activation.logs.toList.flatten.mkString(" ") should include("❄ ☃ ❄")
+        }
       }
-
-      withActivation(
-        wsk.activation,
-        wsk.action.invoke(name, parameters = Map("delimiter" -> 
JsString("❄"))),
-        totalWait = activationPollDuration) { activation =>
-        val response = activation.response
-        response.result.get.fields.get("error") shouldBe empty
-        response.result.get.fields.get("winter") should be(Some(JsString("❄ ☃ 
❄")))
-
-        activation.logs.toList.flatten.mkString(" ") should include("❄ ☃ ❄")
-      }
-    }
   }
 }
 
diff --git a/tests/src/test/scala/system/rest/RestUtil.scala 
b/tests/src/test/scala/system/rest/RestUtil.scala
index 212238f..b844039 100644
--- a/tests/src/test/scala/system/rest/RestUtil.scala
+++ b/tests/src/test/scala/system/rest/RestUtil.scala
@@ -31,11 +31,16 @@ import spray.json._
  */
 trait RestUtil {
 
+  private val skipKeyStore = false // set this to true for convenient local 
testing
   private val trustStorePassword = WhiskProperties.getSslCertificateChallenge
 
   // force RestAssured to allow all hosts in SSL certificates
   protected val sslconfig = {
-    new RestAssuredConfig().sslConfig(new SSLConfig().keystore("keystore", 
trustStorePassword).allowAllHostnames())
+    new RestAssuredConfig().sslConfig(if (!skipKeyStore) {
+      new SSLConfig().keystore("keystore", 
trustStorePassword).allowAllHostnames()
+    } else {
+      new SSLConfig().relaxedHTTPSValidation().allowAllHostnames()
+    })
   }
 
   /**

Reply via email to