Skip to content
Snippets Groups Projects
Commit d6a89200 authored by Carlos Santana's avatar Carlos Santana
Browse files

enable actionllop tests

parent 8ee2d2da
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
......@@ -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 {
......
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment