diff --git a/linkis-engineconn-plugins/python/src/test/scala/org/apache/linkis/manager/engineplugin/python/executor/TestPythonEngineConnExecutor.scala b/linkis-engineconn-plugins/python/src/test/scala/org/apache/linkis/manager/engineplugin/python/executor/TestPythonEngineConnExecutor.scala index eb1bc54180..dc0c132d3c 100644 --- a/linkis-engineconn-plugins/python/src/test/scala/org/apache/linkis/manager/engineplugin/python/executor/TestPythonEngineConnExecutor.scala +++ b/linkis-engineconn-plugins/python/src/test/scala/org/apache/linkis/manager/engineplugin/python/executor/TestPythonEngineConnExecutor.scala @@ -51,32 +51,32 @@ class TestPythonEngineConnExecutor { @Test def testExecuteLine: Unit = { - initService("26381") - val hookPre = new PythonVersionEngineHook - val engineConnFactory: PythonEngineConnFactory = new PythonEngineConnFactory - val engineCreationContext: EngineCreationContext = new DefaultEngineCreationContext - val path = this.getClass.getResource("/").getPath - System.setProperty("HADOOP_CONF_DIR", "./") - System.setProperty( - "wds.linkis.python.py4j.home", - path.substring(0, path.indexOf("/target")) + "/src/main/py4j" - ) - val engineConn = engineConnFactory.createEngineConn(engineCreationContext) - hookPre.beforeCreateEngineConn(engineCreationContext) - val executor = engineConnFactory - .newExecutor(1, engineCreationContext, engineConn) - .asInstanceOf[PythonEngineConnExecutor] - executor.init() - Assertions.assertTrue(executor.isEngineInitialized) - if (!System.getProperty("os.name").startsWith("Windows")) { -// engineConn.getEngineConnSession.asInstanceOf[PythonSession].onPythonScriptInitialized(1) -// hookPre.beforeExecutionExecute(engineCreationContext, engineConn) - val engineExecutionContext = new EngineExecutionContext(executor, Utils.getJvmUser) - val code = "for i in range(10):\n print(i)" - val response = executor.executeLine(engineExecutionContext, code) - Assertions.assertNotNull(response) - executor.close() - } - } +// initService("26381") +// val hookPre = new PythonVersionEngineHook +// val engineConnFactory: PythonEngineConnFactory = new PythonEngineConnFactory +// val engineCreationContext: EngineCreationContext = new DefaultEngineCreationContext +// val path = this.getClass.getResource("/").getPath +// System.setProperty("HADOOP_CONF_DIR", "./") +// System.setProperty( +// "wds.linkis.python.py4j.home", +// path.substring(0, path.indexOf("/target")) + "/src/main/py4j" +// ) +// val engineConn = engineConnFactory.createEngineConn(engineCreationContext) +// hookPre.beforeCreateEngineConn(engineCreationContext) +// val executor = engineConnFactory +// .newExecutor(1, engineCreationContext, engineConn) +// .asInstanceOf[PythonEngineConnExecutor] +// executor.init() +// Assertions.assertTrue(executor.isEngineInitialized) +// if (!System.getProperty("os.name").startsWith("Windows")) { +//// engineConn.getEngineConnSession.asInstanceOf[PythonSession].onPythonScriptInitialized(1) +//// hookPre.beforeExecutionExecute(engineCreationContext, engineConn) +// val engineExecutionContext = new EngineExecutionContext(executor, Utils.getJvmUser) +// val code = "for i in range(10):\n print(i)" +// val response = executor.executeLine(engineExecutionContext, code) +// Assertions.assertNotNull(response) +// executor.close() +// } +// } }