diff --git a/.travis.yml b/.travis.yml index 968b66dfb3eb98f2e9ac0e884fe4180a2dcc6a19..74beae5d522e2d598908f0e9c33dfacbfd29be78 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 29333bc0c6463ab4b055617beaaa0ad57af96629..edc376cffa400216fae11a21f6f6141a7339557c 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 9368b7afd8a2cbe7bf49a18c5aa7b2268c1aea01..e18795d3ec63792c408bbc5984e5f13fe285bfb6 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