enable actionllop tests
diff --git a/.travis.yml b/.travis.yml index 968b66d..74beae5 100644 --- a/.travis.yml +++ b/.travis.yml
@@ -26,7 +26,7 @@ all_branches: true repo: apache/incubator-openwhisk-runtime-python - provider: script - script: "./tools/travis/publish.sh openwhisk 2 latest && ./tools/travis/publish.sh openwhisk 3 latest && ./tools/travis/publish.sh openwhisk 3-ai latest" + script: "./tools/travis/publish.sh openwhisk 2 latest && ./tools/travis/publish.sh openwhisk 3 latest && ./tools/travis/publish.sh openwhisk 3-ai latest && ./tools/travis/publish.sh openwhisk 3-loop latest" on: branch: master repo: apache/incubator-openwhisk-runtime-python
diff --git a/tests/src/test/scala/runtime/actionContainers/PythonActionContainerTests.scala b/tests/src/test/scala/runtime/actionContainers/PythonActionContainerTests.scala index 29333bc..edc376c 100644 --- a/tests/src/test/scala/runtime/actionContainers/PythonActionContainerTests.scala +++ b/tests/src/test/scala/runtime/actionContainers/PythonActionContainerTests.scala
@@ -206,27 +206,30 @@ e should include("Zip file does not include") }) } - /* - it should "run zipped Python action containing a virtual environment" in { - val zippedPythonAction = if (imageName == "python2action") "python2_virtualenv.zip" else "python3_virtualenv.zip" - val zippedPythonActionName = TestUtils.getTestActionFilename(zippedPythonAction) - val code = readAsBase64(Paths.get(zippedPythonActionName)) - val (out, err) = withActionContainer() { c => - val (initCode, initRes) = c.init(initPayload(code, main = "main")) - initCode should be(200) - val args = JsObject("msg" -> JsString("any")) - val (runCode, runRes) = c.run(runPayload(args)) - runCode should be(200) - runRes.get.toString() should include("netmask") - } - checkStreams(out, err, { - case (o, e) => - o should include("netmask") - e shouldBe empty - }) + it should "run zipped Python action containing a virtual environment" in { + val zippedPythonAction = + if (imageName == "python2action") "python2_virtualenv.zip" + else if (imageName == "actionloop-python-v3.7") "python37_virtualenv.zip" + else "python3_virtualenv.zip" + val zippedPythonActionName = TestUtils.getTestActionFilename(zippedPythonAction) + val code = readAsBase64(Paths.get(zippedPythonActionName)) + + val (out, err) = withActionContainer() { c => + val (initCode, initRes) = c.init(initPayload(code, main = "main")) + initCode should be(200) + val args = JsObject("msg" -> JsString("any")) + val (runCode, runRes) = c.run(runPayload(args)) + runCode should be(200) + runRes.get.toString() should include("netmask") } - */ + + checkStreams(out, err, { + case (o, e) => + o should include("netmask") + e shouldBe empty + }) + } it should "run zipped Python action containing a virtual environment with non-standard entry point" in { val zippedPythonAction = @@ -235,24 +238,21 @@ else "python3_virtualenv.zip" val zippedPythonActionName = TestUtils.getTestActionFilename(zippedPythonAction) - // temporary guard to comment out this test - // until python37_virtualenv.zip is available in main repo - if (initErrorsAreLogged) { - val code = readAsBase64(Paths.get(zippedPythonActionName)) - val (out, err) = withActionContainer() { c => - val (initCode, initRes) = c.init(initPayload(code, main = "naim")) - initCode should be(200) - val args = JsObject("msg" -> JsString("any")) - val (runCode, runRes) = c.run(runPayload(args)) - runCode should be(200) - runRes.get.toString() should include("netmask") - } - checkStreams(out, err, { - case (o, e) => - o should include("netmask") - e shouldBe empty - }) + val code = readAsBase64(Paths.get(zippedPythonActionName)) + val (out, err) = withActionContainer() { c => + val (initCode, initRes) = c.init(initPayload(code, main = "naim")) + initCode should be(200) + val args = JsObject("msg" -> JsString("any")) + val (runCode, runRes) = c.run(runPayload(args)) + runCode should be(200) + runRes.get.toString() should include("netmask") } + checkStreams(out, err, { + case (o, e) => + o should include("netmask") + e shouldBe empty + }) + } it should "report error if zipped Python action containing a virtual environment for wrong python version" in {
diff --git a/tools/travis/publish.sh b/tools/travis/publish.sh index 9368b7a..e18795d 100755 --- a/tools/travis/publish.sh +++ b/tools/travis/publish.sh
@@ -36,6 +36,8 @@ RUNTIME="pythonAction" elif [ ${RUNTIME_VERSION} == "3-ai" ]; then RUNTIME="python3AiAction" +elif [ ${RUNTIME_VERSION} == "3-loop" ]; then + RUNTIME="pythonActionLoop" fi if [[ ! -z ${DOCKER_USER} ]] && [[ ! -z ${DOCKER_PASSWORD} ]]; then