This is an automated email from the ASF dual-hosted git repository. csantanapr pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/incubator-openwhisk-runtime-python.git
commit d6a89200ccc34028bbce8dc64bb72f515d432ac3 Author: Carlos Santana <[email protected]> AuthorDate: Sun Jan 13 21:34:41 2019 -0500 enable actionllop tests --- .travis.yml | 2 +- .../PythonActionContainerTests.scala | 72 +++++++++++----------- tools/travis/publish.sh | 2 + 3 files changed, 39 insertions(+), 37 deletions(-) diff --git a/.travis.yml b/.travis.yml index 968b66d..74beae5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -26,7 +26,7 @@ deploy: 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 @@ class PythonActionContainerTests extends BasicActionRunnerTests with WskActorSys 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 @@ class PythonActionContainerTests extends BasicActionRunnerTests with WskActorSys 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 @@ elif [ ${RUNTIME_VERSION} == "3" ]; then 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
