You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@openwhisk.apache.org by GitBox <gi...@apache.org> on 2018/07/10 02:13:33 UTC
[GitHub] dgrove-oss closed pull request #3864: Add bypass for test (failing
in Swift, PHP). Fix NPEs.
dgrove-oss closed pull request #3864: Add bypass for test (failing in Swift, PHP). Fix NPEs.
URL: https://github.com/apache/incubator-openwhisk/pull/3864
This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:
As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):
diff --git a/tests/src/test/scala/actionContainers/ActionContainer.scala b/tests/src/test/scala/actionContainers/ActionContainer.scala
index b9398cda8a..a16888917e 100644
--- a/tests/src/test/scala/actionContainers/ActionContainer.scala
+++ b/tests/src/test/scala/actionContainers/ActionContainer.scala
@@ -21,6 +21,7 @@ import java.io.ByteArrayOutputStream
import java.io.File
import java.io.PrintWriter
+import scala.util.Try
import scala.concurrent.Await
import scala.concurrent.ExecutionContext.Implicits.global
import scala.concurrent.Future
@@ -116,10 +117,14 @@ object ActionContainer {
.get("docker.host")
.orElse(sys.env.get("DOCKER_HOST"))
.orElse {
- // Check if we are running on docker-machine env.
- Option(WhiskProperties.getProperty("environment.type")).filter(_.toLowerCase.contains("docker-machine")).map {
- case _ => s"tcp://${WhiskProperties.getMainDockerEndpoint}"
- }
+ Try { // whisk.properties file may not exist
+ // Check if we are running on docker-machine env.
+ Option(WhiskProperties.getProperty("environment.type"))
+ .filter(_.toLowerCase.contains("docker-machine"))
+ .map {
+ case _ => s"tcp://${WhiskProperties.getMainDockerEndpoint}"
+ }
+ }.toOption.flatten
}
.map(" --host " + _)
.getOrElse("")
diff --git a/tests/src/test/scala/actionContainers/BasicActionRunnerTests.scala b/tests/src/test/scala/actionContainers/BasicActionRunnerTests.scala
index 7831f67a23..07d028dc8a 100644
--- a/tests/src/test/scala/actionContainers/BasicActionRunnerTests.scala
+++ b/tests/src/test/scala/actionContainers/BasicActionRunnerTests.scala
@@ -297,24 +297,26 @@ trait BasicActionRunnerTests extends ActionProxyContainerTestUtils {
it should s"echo a large input" in {
val config = testLargeInput
- var passed = true
+ if (!config.skipTest) {
+ var passed = true
- val (out, err) = withActionContainer() { c =>
- val (initCode, _) = c.init(initPayload(config.code, config.main))
- initCode should be(200)
+ val (out, err) = withActionContainer() { c =>
+ val (initCode, _) = c.init(initPayload(config.code, config.main))
+ initCode should be(200)
- val arg = JsObject("arg" -> JsString(("a" * 1048561)))
- val (_, runRes) = c.run(runPayload(arg))
- if (runRes.get != arg) {
- println(s"result did not match: ${runRes.get}")
- passed = false
+ val arg = JsObject("arg" -> JsString(("a" * 1048561)))
+ val (_, runRes) = c.run(runPayload(arg))
+ if (runRes.get != arg) {
+ println(s"result did not match: ${runRes.get}")
+ passed = false
+ }
}
- }
- if (!passed) {
- println(out)
- println(err)
- assert(false)
+ if (!passed) {
+ println(out)
+ println(err)
+ assert(false)
+ }
}
}
diff --git a/tests/src/test/scala/common/WhiskProperties.java b/tests/src/test/scala/common/WhiskProperties.java
index 64e9c28045..3f2014458c 100644
--- a/tests/src/test/scala/common/WhiskProperties.java
+++ b/tests/src/test/scala/common/WhiskProperties.java
@@ -295,7 +295,9 @@ public static String readAuthKey(File filename) {
*/
public static File getVCAPServicesFile() {
String vcapServices = whiskProperties.getProperty("vcap.services.file");
- if (vcapServices.startsWith(File.separator)) {
+ if (vcapServices == null) {
+ return null;
+ } else if (vcapServices.startsWith(File.separator)) {
return new File(vcapServices);
} else {
return WhiskProperties.getFileRelativeToWhiskHome(vcapServices);
----------------------------------------------------------------
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:
users@infra.apache.org
With regards,
Apache Git Services